Mail Merge from Access 2002 to Word 2003

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?
 
M

Monte Chan

1. Yes, it does only if the customers have chosen to merge with an existing
document. If they choose to merge with a new document, the variable would be
blank.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top