View Single Post
 
Old 04-01-2016, 04:15 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Quote:
Originally Posted by JennEx View Post
I noticed in your code you removed '.MainDocumentType = wdNotAMergeDocument'. I assume it's unnecessary in this application?
Since the code closes your mailmerge main document without saving the changes the code makes to it, that line is unnecessary.

The '.DisplayAlerts = False' line suppresses the mailmerge SQL prompt. Be aware this also causes the document to revert to an ordinary one - which is also why you then need the code you already had for setting the document type, opening the data source, etc. And, of course, one should restore with '.DisplayAlerts = True' before exiting, otherwise important prompts might not be given post-merge.

Quote:
Originally Posted by JennEx View Post
I have just stumbled on the fact that my data source has two columns labelled as 'TYPE', which is one of the SQL criteria. Would this contribute to the problem?
I may but, even if it doesn't, you might find it pulling data from the wrong one! Better to have unique names for all fields.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote