Mail Merging Access 2003

A

Alex

Hi I am trying to create a mail merge using an Access 2003 Query to open a
Word 2003 mailmerge document. I have had this running for at least 18
months in Access 2000, but when we upgrdaed our workstations to Office 2003,
when the mailmerge document opens, the option to Mailmerge to printer is not
lit.

Assuming that my old code no longer works in Access 2003, some kind person
on this forum pointed me to KB209976, which seems to have a lot less code
than I was previously using.

However having created the code below, I can even get past first line. I
get a User-defined type not defined.
Can someone help me please - thanks
A


Public Function Mergeit()

Dim objWord As Word.Document

Set objWord = GetObject("d:\temp\marketing letters\enable
brochureCD.doc", "Word Document")

' make Word visible
objWord.Application.Visible = True

'Set the mail merge data source
objWord.MailMerge.OpenDataSource _
Name:="d:\temp\contacts.mdb", _
LinktoSource:=True, _
Connection:="QUERY QryEnableBrochureDemoCD"

'Execute the MailMerge
objWord.MailMerge.Execute

End Function
 
V

Virgil

You might find a solution in Helen Feddema's book "Expert
One-on-One Microsoft Access Application Development"
published by WROX (www.wrox.com). It has a section dealing
with Word mail merging.
 

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