I need to replace some words, but not italic ones, this code does not works:
(It is replacing all occurrences, even in italic)
Code:
For x = 0 To UBound(TxtF)
With .Range.Find
.Text = TxtF(x)
.Replacement.Text = TxtS(x)
.Format = True
.Font.Italic = False
.MatchWholeWord = False
.MatchCase = True
.Execute Replace:=wdReplaceAll
End With
Next x
Any ideas to fix this?
Thanks
Ps. SORRY using vba breakpoints I found that the problem was elsewhere in the code.