The issue was mainly to do with your SQL statement, especially using 'Sheet1' instead of `Sheet1` (note the shape of the quote marks). You'll see that I've also added some more code to the overall OpenDataSource statement, which now spans 7 lines, to ensure all relevant parameters are used.
As for your document, simply answer 'no' to the prompt, then save.
You would definitely need a different document for labels and envelopes. The code would also need modification if it were to handle each kind, since it would need to call those different documents and tell Word what kind of merge to execute. That entails rather more than just a message box.
PS: Please don't keep quoting entire previous posts in your replies. If you need to quote something, quote only that part; otherwise don't quote anything - it just wastes screen space and board storage.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|