I use the following to find a word in a word document opened in a DSOFramer ActiveX control:
The code finds and highlights the first occurence of the word "control" but ignores all of the other occurences.Code:oDoc = ctl.ActiveDocument oDoc.ActiveWindow.Selection.WholeStory() oDoc.ActiveWindow.Selection.Find.ClearFormatting() oDoc.ActiveWindow.Selection.Find.Replacement.ClearFormatting() With oDoc.ActiveWindow.Selection.Find .Text = "control" .Forward = True .Wrap = WdFindWrap.wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With oDoc.ActiveWindow.Selection.Find.Execute()
What am I doing wrong ? I must be missing something easy.





Reply With Quote