Printing a MailMerged Document From Access 2003

D

Darrin

I have a document that is merged from within access; however when I go
to print the document, the document prints without the MailMerge. Can
anyone help? Here is my code:

Set WordObj = CreateObject("Word.Application")
Set dc = WordObj.Documents.Open("C:\temp.doc")
dc.Destination = wdSendToNewDocument
dc.MailMerge
dc.SuppressBlankLines
dc.Execute
dc.PrintOut
WordObj.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
WordObj.Quit

Any suggestions?
 
C

Cindy Meister -WordMVP-

Hi Darrin,
I have a document that is merged from within access; however when I go
to print the document, the document prints without the MailMerge. Can
anyone help? Here is my code:

Set WordObj = CreateObject("Word.Application")
Set dc = WordObj.Documents.Open("C:\temp.doc")
dc.Destination = wdSendToNewDocument
dc.MailMerge
dc.SuppressBlankLines
dc.Execute
dc.PrintOut
WordObj.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
WordObj.Quit
I'm surprised you're not getting error messages... a document object
doesn't have all the properties and methods you're trying to use. The
mail merge property of the document object does. You need to take out
the On Error Resume Next you've stuck in your code so that it tells you
when you're hitting mistakes. These are the lines I think you need to
correct:

With dc.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines
.Execute
End With
WordObj.ActiveDocument.PrintOut

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top