View Single Post
 
Old 01-31-2011, 10:54 PM
Michael007 Michael007 is offline Windows 7 64bit Office 2003
Novice
 
Join Date: Dec 2010
Posts: 18
Michael007 is on a distinguished road
Default Change fonts of a defined word with VBA

Hi Paul,

I had already tried a few time to do that via the macro recorder. While I can modify with success the color of a word via Find/Replace, it seems that the code recorded contains no specific command in term of the new color.

This is what I got from the operation where I changed "FQCN73 in red:

Code:
Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "FQCN73"
        .Replacement.Text = "FQCN73"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

Michael
Reply With Quote