Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Highlight all instances of a word in MS-Word
Message
De
02/07/2008 12:54:34
 
 
À
02/07/2008 12:10:46
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01328241
Message ID:
01328295
Vues:
8
Thanks alot

peter

>>Can I open word like this
>>
>>
>>LOCAL o as word.application
>>oWord=CREATEOBJECT("Word.Application")
>>oDoc=oWord.Documents.Open("c:\vapps\vcpr3\temp\test.doc")
>>
>>
>>an highlight all instances of let's say the word King (whole word only)
>>
>>i can't find a way in word itself but there must be!
>>
>>Peter
>
>
>
>LOCAL oWord AS "Word.Application"
>oWord = CREATEOBJECT("Word.Application")
>oWord.Documents.Open("c:\vapps\vcpr3\temp\test.doc")
>
>oWord.Visible = .t.
>loSelection = oWord.ActiveWindow.ActivePane.SELECTION
>loSelection.Find.ClearFormatting()
>loSelection.Find.Replacement.Highlight = .t.
>
>WITH loSelection.Find
>     .Text = "king"
>     .Replacement.Text = "king"
>     .Forward = .t.
>     .Wrap = 1
>     .Format = .t.
>     .MatchCase = .f.
>     .MatchWholeWord = .t.
>     .MatchWildcards = .f.
>     .MatchSoundsLike = .f.
>     .MatchAllWordForms = .f.
>ENDWITH
>loSelection.Find.Execute(,,,,,,,,,,2)
>
Peter Cortiel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform