J
JayM
I have a template document on which I want to be able to change lightblue to
black after drafting the document.
I have the following code in my macro at the moment and it works ok I just
wondered if there was a more efficient way of writing it that I haven't
thought of or if I should do some error checking on it as well.
Still finding my way around vba at the moment and am improving with the help
of this site.
Public Sub SetTextToBlack()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Font.Color = wdColorLightBlue
.Replacement.Font.Color = wdColorBlack
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAll
Selection.MoveRight
End Sub
Many thanks
JayM
black after drafting the document.
I have the following code in my macro at the moment and it works ok I just
wondered if there was a more efficient way of writing it that I haven't
thought of or if I should do some error checking on it as well.
Still finding my way around vba at the moment and am improving with the help
of this site.
Public Sub SetTextToBlack()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Font.Color = wdColorLightBlue
.Replacement.Font.Color = wdColorBlack
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAll
Selection.MoveRight
End Sub
Many thanks
JayM