View Single Post
 
Old 01-04-2014, 04:34 AM
Sankar Tech Sankar Tech is offline Windows XP Office 2007
Novice
 
Join Date: Jan 2014
Posts: 8
Sankar Tech is on a distinguished road
Default 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
Reply With Quote