Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Automation Fails...
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word Automation Fails...
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01094192
Message ID:
01094192
Vues:
46
Using Word 2003. Can anyone explain why the following works when executed from the Command Window ...
oWord = newobject('word.application')           && returns an object
oDoc = oWord.Documents.Open('WorkingFile.doc')  && returns an object
loRange = oWord.ActiveDocument.Range(0,0)       && returns an object
loRange.Find.Execute('OldVal', , , , , , .T., , , 'NewVal', , , , 2) && returns .T.
oWord.Visible = .T. && I can visually verify the replace occured
... but fails when I run it from a PRG? The only difference is the code above is in a PRG class and all the variables are now properties of the class (e.g., THIS.oWord, THIS.oDocument). loRange is just a variable created in a method.
Mark McCasland
Midlothian, TX USA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform