I'm writing a VBA macro from Excel. The user supplies the information for an invoice by responding to Userforms in the Excel environment. The macro takes the input information, adds tied information (addresses tied to recipient names, product descriptions and prices tied to product numbers, etc.) and puts them into an Excel sourcesheet to be incorporated automatically into the word document, which already exists as a template. I have solved the problem of getting the appropriate information in at bookmarks in the document and getting to the bookmark in the document that indicates where the table with the product information will be.
I need to create the table in the word documents with a number of rows appropriate to the different types of products (they've ordered 1 of A, 3 of B, which would be two rows) (no problem with the counting bit) and fill it with the data from the Excel sourcesheet. Entries in the 3rd column of the table will vary from one line to ten, with some lines involving the incorporation of data from the Excel sourcesheet (serial numbers, commodity codes). For now, can you just help me with getting the table created in the word document?
With the word application open and the appropriate word document open, the bookmarked data already in, and the cursor at the place where I want the table (all done by the macro), this does not work, but probably show how much a beginner I am at this.
Dim Goods as Table
Goods.Add(tblrng,iRows,5)
DJCNOR
I need to create the table in the word documents with a number of rows appropriate to the different types of products (they've ordered 1 of A, 3 of B, which would be two rows) (no problem with the counting bit) and fill it with the data from the Excel sourcesheet. Entries in the 3rd column of the table will vary from one line to ten, with some lines involving the incorporation of data from the Excel sourcesheet (serial numbers, commodity codes). For now, can you just help me with getting the table created in the word document?
With the word application open and the appropriate word document open, the bookmarked data already in, and the cursor at the place where I want the table (all done by the macro), this does not work, but probably show how much a beginner I am at this.
Dim Goods as Table
Goods.Add(tblrng,iRows,5)
DJCNOR