Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access2003/Word2003 Mail Merge

Status
Not open for further replies.

KenReay

Programmer
Aug 15, 2002
5,424
GB
I am attmpting to automate Word Mail merge from Access, using code like

set wobj = GetObject(,"Word.Application")
set oDoc = GetObject(strLetterName,"Word.Document")

With oDoc
.MailMerge.OpenDataSource
Name:=Db.Name,
LinkToSource:=True,
Connection:="QUERY qMailMergeClient",
SQLStatement:="SELECT * FROM qMailMergeClient"

..etc

Anyone done this successfully and willing to discuss?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
I think you should be able to get/create an instance of Word with with your merge document using just:

[tt]set oDoc = GetObject(strLetterName)
' then
set wobj = odoc.parent ' if you need the parent object[/tt]

I think one of the challenges with the above, is that it may open an extra instance of Access (the query). So last time I had to do some mailmerge, I had a look at pseale's faq faq181-5088, which circumvents some of that hassle.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top