K
Kay
Hello all,
Our goal is to find any text with formatting of Arial, bold Italic and 14
pts and replace that with a Heading 2 Style. If you record the macro the
steps work, but nothing happens when you play back the macro on another
document. My code is below.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 5/21/2008 by Genzyme Corporation
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Heading 2")
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
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
End Sub
YOur help will be appreciated.
Our goal is to find any text with formatting of Arial, bold Italic and 14
pts and replace that with a Heading 2 Style. If you record the macro the
steps work, but nothing happens when you play back the macro on another
document. My code is below.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 5/21/2008 by Genzyme Corporation
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Heading 2")
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
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
End Sub
YOur help will be appreciated.