All, I am using some code to automate merging word documents. But, I have to refernce the correct ms word version. But the users have different versions of owrd (2007, 2010). How do I avoid the errors I would get, if I set the version to 14 and a user only has 12.
Is there a way to create a word merge object without setting the reference to the version of ms word?
Here is some of my code.
David Pimental
(US, Oh)
Is there a way to create a word merge object without setting the reference to the version of ms word?
Here is some of my code.
Code:
Dim WordApp As Word.Application
Dim WordDoc As Word.Document
Dim WordMerge As Word.MailMerge
Dim strlnk As String
Dim dbpathname As String
dbpathname = "Z:\Database\RMOracleMailMerge2012.mdb"
strlnk = "Z:\Letters\Release\Active\12FnlReleaseAckStd_David.doc"
Set WordApp = New Word.Application
Set WordDoc = WordApp.Documents.OPEN(fileName:="""" & strlnk & """", _
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto, XMLTransform:="")
Set WordMerge = WordDoc.MailMerge
WordMerge.OpenDataSource _
NAME:=dbpathname, _
LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="Query Release_Mail_Mege", _
SQLStatement:="Select * FROM [Release_Mail_Mege] where [ORDER_ID] = 950711"
David Pimental
(US, Oh)