In the sub below I need to make line six return 'true' on any OTHER font that
the one listed. I've tried all the normal operands and nothing works.

The sub purpose is to replace all fonts with one single font.

Thanks,

Mike


Sub ReplaceFont()
With Selection.Find
' Clear all previously set formatting for Find dialog box.
.ClearFormatting
' Set font to Find for replacement.
.Font.Name = "Arial"
' Clear all previously set formatting for Replace dialog box.
.Replacement.ClearFormatting
' Set font to Replace found font.
.Replacement.Font.Name = "Times New Roman"
' Don't find or replace any text.
.Text = ""
.Replacement.Text = ""
' The following parameters must be set as follows
' to find only text formatted for the specified font.
' .Forward = True
' .Wrap = wdFindContinue
' .Format = True
' .MatchCase = False
' .MatchWholeWord = False
' .MatchWildcards = False
' .MatchSoundsLike = False
' .MatchAllWordForms = False
End With
' Perform the find and replace.
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Re: I need IS NOT (<>) operand for Font.Name by Greg

Greg
Sun Sep 09 11:57:35 CDT 2007

I don't think you can do it that way.

Maybe:

Sub ScratchMacro()
Dim oPar As Word.Paragraph
For Each oPar In ActiveDocument.Range.Paragraphs
oPar.Range.Font.Name = "Times New Roman"
Next oPar
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

"jg0017" <jg0017@discussions.microsoft.com> wrote in message
news:8DC7F452-BCE9-4ECF-A3F9-045541A8151A@microsoft.com...
> In the sub below I need to make line six return 'true' on any OTHER font
> that
> the one listed. I've tried all the normal operands and nothing works.
>
> The sub purpose is to replace all fonts with one single font.
>
> Thanks,
>
> Mike
>
>
> Sub ReplaceFont()
> With Selection.Find
> ' Clear all previously set formatting for Find dialog box.
> .ClearFormatting
> ' Set font to Find for replacement.
> .Font.Name = "Arial"
> ' Clear all previously set formatting for Replace dialog box.
> .Replacement.ClearFormatting
> ' Set font to Replace found font.
> .Replacement.Font.Name = "Times New Roman"
> ' Don't find or replace any text.
> .Text = ""
> .Replacement.Text = ""
> ' The following parameters must be set as follows
> ' to find only text formatted for the specified font.
> ' .Forward = True
> ' .Wrap = wdFindContinue
> ' .Format = True
> ' .MatchCase = False
> ' .MatchWholeWord = False
> ' .MatchWildcards = False
> ' .MatchSoundsLike = False
> ' .MatchAllWordForms = False
> End With
> ' Perform the find and replace.
> Selection.Find.Execute Replace:=wdReplaceAll
> End Sub