M
Mark
I'm using Access 2003 to mail merge to a Word 2003 doc.
Below is the code that I modified from the microsoft website.
=========================
Dim strWordDocName As String
Dim objWord As Word.Document
Dim strTableName As String
strTableName = "MAILMERGESUBSET"
strWordDocName = "S:\PATH\MailMerge.doc"
Set objWord = GetObject(strWordDocName, "Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:=CurrentProject.FullName, _
linktosource:=True, _
Connection:="QUERY MAILMERGESUBSET", _
ReadOnly:=True, _
sqlstatement:="select * from mailmergesubset"
objWord.MailMerge.Execute
=========================
When I try to run th ecode above, I get the following error
"The operation cannot be completed because of dialog of database engine
failures. Please Try again later."
Notes:
* MAILMERGESUBSET is a query off a table, and all the query is doing is
selecting all records from the table where a charge_amt >0". No query
parameters, no parameters based on forms, etc.
* When I open the word doc, it merges just fine.
Any help appreciated!
-Mark
Below is the code that I modified from the microsoft website.
=========================
Dim strWordDocName As String
Dim objWord As Word.Document
Dim strTableName As String
strTableName = "MAILMERGESUBSET"
strWordDocName = "S:\PATH\MailMerge.doc"
Set objWord = GetObject(strWordDocName, "Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:=CurrentProject.FullName, _
linktosource:=True, _
Connection:="QUERY MAILMERGESUBSET", _
ReadOnly:=True, _
sqlstatement:="select * from mailmergesubset"
objWord.MailMerge.Execute
=========================
When I try to run th ecode above, I get the following error
"The operation cannot be completed because of dialog of database engine
failures. Please Try again later."
Notes:
* MAILMERGESUBSET is a query off a table, and all the query is doing is
selecting all records from the table where a charge_amt >0". No query
parameters, no parameters based on forms, etc.
* When I open the word doc, it merges just fine.
Any help appreciated!
-Mark