I am currently using the code below within a VB.Net application to find specific text in a Word document. The text is surrounded by symbols represented by the character codes in the .Text statement. The code below is working fine. The issue now is that sometimes the desired text within a document has been marked for deletion and appears as tracked change within the document. I would like to find only the desired text that has NOT been marked for deletion. Does anyone know of a way to determine if the found text is a deletion?
xSelection.MoveStart(Word.WdUnits.wdStory)
xSelection.Find.ClearFormatting()
xSelection.Find.Replacement.ClearFormatting()
With xSelection.Find
.Text = ChrW(65000) & "( \[*)" & ChrW(65001)
.Replacement.Text = ""
.Forward = True
.Wrap = Word.WdFindWrap.wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchFuzzy = False
.MatchWildcards = True
End With
xSelection.Find.Execute(Replace:=Word.WdReplace.wdReplaceNone)
Do While xSelection.Find.Found
........Execute additional code here
Loop