Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word automation - replacing text
Message
De
12/10/2009 21:26:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word automation - replacing text
Divers
Thread ID:
01429077
Message ID:
01429077
Vues:
101
In the Visual FoxPro code, I have:


WITH loWord.oWord.Selection.Find
...
.Text = "[Anschrift1]"
.Replacement.Text = ALLTRIM(Anschrift1)
.Execute(wdReplaceAll)
ENDWITH

loWord is a reference to a class that does some help with Word automation; the oWord object allows me to access the Word object model.

The idea is to have standard texts as "markers" where variable texts should be replaced.

Before executing the .Execute(wdReplaceAll), that actually does the replacing, .Text has the specified value. Why would this jump to the value 2 (which happens to be the value of constant wdReplaceAll) as soon as the .Execute(...) is executed? Also, the results indicate that this is what has been replaced. The text "2" was replaced with the replacement text.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform