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?
Peter Jamieson - 02 Mar 2007 19:20 GMT
1. Does stMergeDoc contain the full pathname of the document?
2. You may need to take account of the following article (don't be put off
by the title):
http://support.microsoft.com/kb/825765
Peter Jamieson
>I have an Access software that has a feature to allow my customers to do
>mail
[quoted text clipped - 25 lines]
> this
> error please?
Monte Chan - 02 Mar 2007 23:35 GMT
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.
> 1. Does stMergeDoc contain the full pathname of the document?
>
[quoted text clipped - 34 lines]
> > this
> > error please?