![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#2
|
||||
|
||||
|
There are numerous problems with your code, including the fact that despite declaring and setting a reference to the document you want to work with, your code then reverts to using 'ActiveDocument'. This and most of the rest of the code you're using if you simply used a purpose-designed template at the '.Documents.Add' point, with the required Style definitions, table and other standard content in-situ, instead of trying to use a new document at the created from Word's default template then applying all that content and using hard formatting to override the existing Styles. If the template contained bookmarks to denote where the QueryA & QueryB output were to go, that would further simplify the document creation.
PS: When posting code, please use the code tags, indicated by the # button on the posting menu.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| add, tables, vba |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding furigana to a Word document | rjribbit | Word | 0 | 12-03-2015 09:33 AM |
Inexperienced user having dificulty adding text to document I created. Fixed text moves around.
|
Athalwolf | Word | 2 | 02-08-2015 09:08 AM |
Error message opening a document in Word "Word cannot open this file because it is larger than 512 M
|
poonamshedge | Word | 2 | 09-11-2014 06:11 AM |
Adding and Moving parts of a document in Word
|
PauledInAction | Word | 4 | 07-13-2012 02:38 PM |
| Adding bullets in a protected Word document | Cindylu3 | Word | 0 | 10-03-2008 03:16 PM |