I need to create a macro to change all fonts of "Times" to "Times New
Roman" in a document. I have that code below. However, my code does not
change the font in some places, for example, in some parts of tables,
headers/footers and in footnotes. How do I add to this code to cover
those areas too?
Sub Times_to_TNR()
'
' Times_to_TNR Macro
' Macro created 1/13/2007 by
'
' Turn screen updating off
Application.ScreenUpdating = False
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
'**********************
.Text = ""
.Font.Name = "Times"
.Replacement.Text = ""
.Replacement.Font.Name = "Times New Roman"
'**********************
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
MsgBox "Done converting font style Times to Times New Roman",
vbOKOnly
End Sub
Kim - 15 Jan 2007 17:08 GMT
> I need to create a macro to change all fonts of "Times" to "Times New
> Roman" in a document. I have that code below. However, my code does not
[quoted text clipped - 36 lines]
>
> End Sub
Reposting to word.vba.general. Sorry!
macropod - 21 Jan 2007 01:38 GMT
Hi Kim,
It's generally not good practice to change character formatting this way. The
preferred way to change the formatting of the underlying paragraph styles.
Doing it this way deals with all text in the document, plus any that may be
added later.
Cheers

Signature
macropod
[MVP - Microsoft Word]
| I need to create a macro to change all fonts of "Times" to "Times New
| Roman" in a document. I have that code below. However, my code does not
[quoted text clipped - 36 lines]
|
| End Sub