ReplaceAll option is not replace all items
Hi,
Requirement: Replace all italic text to tagged text.(<I>XXX</I>)
Issue: ReplaceAll options skip some italic text in Endnotes and Footnotes
Tried code:
Sub Test()
Dim sFindRange As Range
For Each sFindRange In ActiveDocument.StoryRanges
sFindRange.Find.ClearFormatting
sFindRange.Find.Replacement.ClearFormatting
sFindRange.Find.Font.DoubleStrikeThrough = False
sFindRange.Find.Font.Italic = True
sFindRange.Find.Replacement.Font.Italic = True
sFindRange.Find.Replacement.Font.DoubleStrikeThrou gh = True
sFindRange.Find.Execute FindText:="", Replacewith:="<I>^&</I>", Forward:=True, Wrap:=wdFindContinue, Format:=True, MatchCase:=False, MatchWholeWord:=False, MatchWildcards:=False, MatchSoundsLike:=False, MatchAllWordForms:=False, Replace:=wdReplaceAll
Next
End Sub
Please help to resolve above mention problem, kindly let me know for any more details.
Thanks in advance
Sankar B
|