0

I am able to find and replace in word, however all I want to know is if the word was found, I have tried the following code:
This works

     oDoc.Content.Find.Execute(FindText:=x, ReplaceWith:=y, Replace:=Word.WdReplace.wdReplaceAll)

This never give the true statement

                     oDoc.Content.Find.Text = x
                        If oDoc.Content.Find.Found = True Then

But why not?

2
Contributors
2
Replies
16
Views
4 Years
Discussion Span
Last Post by UKnod
0

try to do it with selection instead of content. Make sure you start with selection.collapse if you don't want the search to be within the selected area only.

0

there isn't a selection option

oDoc is a word.document

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.