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
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