Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlight all instances of a word in MS-Word
Message
From
02/07/2008 12:54:34
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01328241
Message ID:
01328295
Views:
7
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
Previous
Reply
Map
View

Click here to load this message in the networking platform