topdesk123
Programmer
I use the following code to open and merge customer letters.
Dim objWord As Word.Document
Set objWord = GetObject("C:\client\customer bid letter.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source
objWord.MailMerge.OpenDataSource _
Name:="C:\client\templettertable.xls", _
LinkToSource:=True, _
Connection:="TABLE templettertable", _
SQLStatement:="SELECT * FROM [templettertable.xls]"
' Execute the mail merge.
objWord.MailMerge.Execute
For references I have Microsoft Word 10.0 Object Library and Microsoft Office 11.0 Object Library. I am using Word 2002 SP3 - my client is using Word 2003 SP1 - the only difference in their references is Word 2003 Object Library. When they try and print letters they get an automation error. Is there something I can modify in my code to avoid this problem? I'm assuming each machine could potentially have different versions installed.
Thank you so much!
topdesk123
Dim objWord As Word.Document
Set objWord = GetObject("C:\client\customer bid letter.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source
objWord.MailMerge.OpenDataSource _
Name:="C:\client\templettertable.xls", _
LinkToSource:=True, _
Connection:="TABLE templettertable", _
SQLStatement:="SELECT * FROM [templettertable.xls]"
' Execute the mail merge.
objWord.MailMerge.Execute
For references I have Microsoft Word 10.0 Object Library and Microsoft Office 11.0 Object Library. I am using Word 2002 SP3 - my client is using Word 2003 SP1 - the only difference in their references is Word 2003 Object Library. When they try and print letters they get an automation error. Is there something I can modify in my code to avoid this problem? I'm assuming each machine could potentially have different versions installed.
Thank you so much!
topdesk123