C
Cissy
Hi and thanks for your help. I'm using Word XP, I have a macro that will
replace a set of home-grown numbering styles with the Heading styles. It
works great! Except when one of the styles I'm replacing has formatting
applied on top of the style, then it does not replace it.
So far I have:
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("IRWL1_L1")
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Heading 1")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
As soon as it comes across "IRWL1_L1" with some underlining, it fails. How
can I rewrite this to catch all incidents of the IRWL1_L1 style even if it
has direct formatting? Thanks much!
replace a set of home-grown numbering styles with the Heading styles. It
works great! Except when one of the styles I'm replacing has formatting
applied on top of the style, then it does not replace it.
So far I have:
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("IRWL1_L1")
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Heading 1")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
As soon as it comes across "IRWL1_L1" with some underlining, it fails. How
can I rewrite this to catch all incidents of the IRWL1_L1 style even if it
has direct formatting? Thanks much!