Find/Replace Font change

A

Al

I need a macro to replace all text and numerals to Times Roman. I had a
simple two line macro which had Selection whole story but my symbols got
lost when they were changed to TR(plus minus, greater equal etc.). I tried
recording macro:
Find any letter
Replace with find what text - font Times Roman
But the resulting recorded macro does not have the font change.
It workd from the Find Replace but not from the macro (since the macro does
not have the font change)

I added the following to the macro:
Selection.Find.Replacement.Font.Name = "Times New Roman"
And it works OK, but is slow. Is there a faster way to do this?
 
J

Joost Verdaasdonk

Hi,

If you're code is Style based you could replace one style
for another.

Lets say; Normal for Heading 1:

Sub ReplaceIt()
With Selection.Find
.ClearFormatting
.Style = ActiveDocument.Styles("Normal")
.Replacement.ClearFormatting
.Replacement.Style = ActiveDocument.Styles
("Heading 1")
.Execute Replace:=wdReplaceAll
End With
End Sub

Enjoy,
Joost Verdaasdonk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top