Thread: [Solved] Can't merge mail from Excel
View Single Post
 
Old 04-06-2014, 03:04 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote