Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error automating Word: OLE IDispatch exception code 0...
Message
De
18/07/2000 11:15:33
Karl Zercoe
Titanium Software, Inc.
Houston, Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Error automating Word: OLE IDispatch exception code 0...
Divers
Thread ID:
00393836
Message ID:
00393836
Vues:
83
I am using VFP 6.0 SP3 to automate Word 97 SR2. I periodically get the error message “OLE IDispatch exception code 0 from MSWord. Object has been deleted.”

The code is running through the FormFields collection with code like
* oAD is a pointer to the ActiveDocument
for each oField in oAD.FormFields
cFieldName = oField.Name
endfor

What makes this odd is that I actually do this twice. I open a specific Word document, scan through the collection of bookmarks/fields and stuff them with values from a table. I then activate Word and let the user fill in any missing field values. When they return to VFP I run through the collection again saving their entries.

The first time works fine, the second generates the error message.

I can also reference the Word field objects by the syntax oAD.FormFields[nIndex] and when I do that I find that out of the 53 fields in the collections I can reference the fields at location 1, and 25-53. The fields between 2 and 24 all generate the error message.

Any suggestions would be appreciated.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform