K
Karen Sigel
In Word 2003, I've written a macro to change specific parts of the text in a
document to Dark Red (RGB 128,0,0) with a Find/Replace. I tested and created
the Find/Replace first, then duplicated the actions to record the macro.
When I do the F/R manually, it works just fine; it also works while I'm
recording it. After I finish the recording and run the macro, however, it
does everything EXCEPT change the color. What am I doing wrong and how can I
fix it?
Here's the text of my macro:
' FixResumeProjectName Macro
' Macro recorded 6/25/2008 by klsigel
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "---*---"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "---"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Thanks-
Karen
document to Dark Red (RGB 128,0,0) with a Find/Replace. I tested and created
the Find/Replace first, then duplicated the actions to record the macro.
When I do the F/R manually, it works just fine; it also works while I'm
recording it. After I finish the recording and run the macro, however, it
does everything EXCEPT change the color. What am I doing wrong and how can I
fix it?
Here's the text of my macro:
' FixResumeProjectName Macro
' Macro recorded 6/25/2008 by klsigel
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "---*---"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "---"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Thanks-
Karen