Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mail Merge of Word 2003
Message
De
15/04/2004 15:31:06
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Mail Merge of Word 2003
Divers
Thread ID:
00895297
Message ID:
00895297
Vues:
78
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
Fil
Voir

Click here to load this message in the networking platform