Mail Merge Error in 2003

J

Joanne

When setting the Destination property of a MailMerge
object from Access 2003 I get the error
message "Requested Object is not Available". I am using
Word 2003 and the data source (a text file) is already
linked to the Word document. VBA is just doing the mail
merge. The code below works fine in Office 2002.

Any suggestions?


Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim wrdMailMerge As Word.MailMerge

Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Open("C:\TIN.DOC")
Set wrdMailMerge = wrdDoc.MailMerge

wrdMailMerge.Destination = wdSendToPrinter
wrdMailMerge.Execute False

wrdDoc.Close False
Set wrdMailMerge = Nothing
Set wrdDoc = Nothing
Set wrdApp = Nothing
 
D

Doug Robbins

That destination should be available

If you insert

MsgBox wrdMailMerge.State

Before the .Execute command, does it return 2, indicating that the document
is a merge document with a data source?

Aside from that, it's usually better to execute the merge to a document,
print that , then closed it without saving it. Saves have to confirm that
you want the document to print.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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