E
Emma Aumack
Hi all,
Using A2K Office 2K, I am trying to automate a mailmerge from my access
database. Using the code from Article 209976 as revised below, I am getting
the error "Word unable to open datasource" can anyone tell me why?
Function MergeItExp()
Dim objWord As Word.Document
Set objWord =
GetObject("G:\USER\Contracts\Data_Files\Access_Security\Expire_letter.doc",
"Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="G:\USER\Contracts\Data_Files\Access_Security\Copy (2) of
Contracts_Database.mdb", _
LinkToSource:=True, Connection:="TABLE 1_Expired_Letters", _
SQLStatement:="SELECT * from 1_Expired_Letters"
' Execute the mail merge.
objWord.MailMerge.Execute
End Function
Thank you,
Using A2K Office 2K, I am trying to automate a mailmerge from my access
database. Using the code from Article 209976 as revised below, I am getting
the error "Word unable to open datasource" can anyone tell me why?
Function MergeItExp()
Dim objWord As Word.Document
Set objWord =
GetObject("G:\USER\Contracts\Data_Files\Access_Security\Expire_letter.doc",
"Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="G:\USER\Contracts\Data_Files\Access_Security\Copy (2) of
Contracts_Database.mdb", _
LinkToSource:=True, Connection:="TABLE 1_Expired_Letters", _
SQLStatement:="SELECT * from 1_Expired_Letters"
' Execute the mail merge.
objWord.MailMerge.Execute
End Function
Thank you,