Changing font name in entire document (including headers and footers)

R

Rick

What is the best VBA code to use to change the font name in my entire
document, including headers and footers? Before I learned about range
objects, I would use Selection:

Selection.WholeStory
Selection.Font.Name = "Franklin Gothic Book"

But that doesn't change the font in header/footer text. AND it
requires another command to unselect.

Can I use a range object to do what I want?
 
D

Doug Robbins - Word MVP

It is definitely better to use the Range object, but you will still have to
access all of the StoryRanges in the document. There is code to do this in
the article "Using a macro to replace text where ever it appears in a
document including Headers, Footers, Textboxes, etc." at:

http://www.word.mvps.org/FAQs/MacrosVBA/FindReplaceAllWithVBA.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
J

Jean-Guy Marcil

Rick was telling us:
Rick nous racontait que :
What is the best VBA code to use to change the font name in my entire
document, including headers and footers? Before I learned about range
objects, I would use Selection:

Selection.WholeStory
Selection.Font.Name = "Franklin Gothic Book"

But that doesn't change the font in header/footer text. AND it
requires another command to unselect.

Can I use a range object to do what I want?

See:

http://word.mvps.org/faqs/macrosvba/FindReplaceAllWithVBA.htm
 

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