Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word automation Replace
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01682265
Message ID:
01682269
Vues:
61
>Hi, i need to know if i can make a replace in a word document when the text i need to change is inserted into a box... I can replace all text not in a box with this code
>
>loWord.Application.Selection.Find.Execute(lcOldText,,,,,,.T.,wdFindContinue,,lcNewText,wdReplaceAll)
>
>But this doesn't work with in box text
>
>Thanks

Something of this sort:

loDoc = loWord.ActiveDocument
FOR EACH loShape IN loDoc.Shapes
loShape.TextFrame.TextRange.Find.Execute(lcOldText,,,,,,.T.,wdFindContinue,,lcNewText,wdReplaceAll)
ENDFOR

Also best to avoid working on selection, instead try to work on range objects.
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform