K
Krumrei
I need the ability to take an exsisting Style within a Doc. and have a macro
to change the name of a specific style.
So for instance, I need Bold Header1 to be renamed Bold Header2
I have been looking at the replace feature in VB, but it does not seem to be
working. Here is the code I created to do that.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Style = ActiveDocument.Styles("Body Text_ACSSC")
.Text = ""
.Replacement.Style = ActiveDocument.Styles("Body Text_ACS")
.Execute Replace:=wdReplaceAll
to change the name of a specific style.
So for instance, I need Bold Header1 to be renamed Bold Header2
I have been looking at the replace feature in VB, but it does not seem to be
working. Here is the code I created to do that.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Style = ActiveDocument.Styles("Body Text_ACSSC")
.Text = ""
.Replacement.Style = ActiveDocument.Styles("Body Text_ACS")
.Execute Replace:=wdReplaceAll