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
Greg Maxey - 09 Sep 2007 17:57 GMT
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

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> In the sub below I need to make line six return 'true' on any OTHER font
> that
[quoted text clipped - 33 lines]
> Selection.Find.Execute Replace:=wdReplaceAll
> End Sub