M
Monte Chan
I have an Access software that has a feature to allow my customers to do mail
merge. The following is the code,
Set WordApp = CreateObject("Word.Application")
If stMergeDoc = "" Then 'Create a new Word doc
Set WordDoc = WordApp.Documents.Add
Else 'Open the word document selected by the user
Set WordDoc = WordApp.Documents.Open(stMergeDoc)
'Set objWord = GetObject(stMergeDoc, "Word.Document")
End If
*Note: strMergeDoc is the name of the document. We allow our customers to
merge with an existing document. If they want to merge with an existing
document, the variable, strMergeDoc, would have the name of the existing
document. If not, it would be blank.
The problem that I am having is, when one of my customers who has Word 2003
tries to do a mail merge, an error comes up saying "Cannot Open Microsoft
Word." However, this code has worked for years on any Word version prior to
2002. May I ask if anyone can point me to the right direction in fixing this
error please?
merge. The following is the code,
Set WordApp = CreateObject("Word.Application")
If stMergeDoc = "" Then 'Create a new Word doc
Set WordDoc = WordApp.Documents.Add
Else 'Open the word document selected by the user
Set WordDoc = WordApp.Documents.Open(stMergeDoc)
'Set objWord = GetObject(stMergeDoc, "Word.Document")
End If
*Note: strMergeDoc is the name of the document. We allow our customers to
merge with an existing document. If they want to merge with an existing
document, the variable, strMergeDoc, would have the name of the existing
document. If not, it would be blank.
The problem that I am having is, when one of my customers who has Word 2003
tries to do a mail merge, an error comes up saying "Cannot Open Microsoft
Word." However, this code has worked for years on any Word version prior to
2002. May I ask if anyone can point me to the right direction in fixing this
error please?