Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Mail Merge of Word 2003
Hi Everyone,
We have a code in mail merge which runs successfully on version lower than Office 2003.
If we use Office 2003, it has a problem.
It will give an error message
“Error Message: OLE IDispatch exception code 0 from Microsoft Word: Requested object is not available...”
Below is our Visual Foxpro 8.0 code.
====================================
lcFileName = getfile("doc")
PUBLIC goWordApp, goWordDoc
goWordApp = createobject("Word.Application")
goWordApp.Visible = .t.
goWordApp.WindowState = 0
goWordDoc = goWordApp.Documents.Open(lcFileName)
with goWordDoc.MailMerge
.Destination = 1
.Execute
endwith
goWordDoc.Close(.f.)
goWordApp.Quit(.f.)
release goWordDoc, goWordApp
Looks to me that there are changes on Word 2003 object implementation.
The code that has the problem is in “.Destination = 1”
Anybody know what changes shall we do so that we can run it on Word 2003?
Also, what code shall we put so that it can support lower Office version #?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement