Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to Change Font in ALL Styles

Status
Not open for further replies.

fishey

Instructor
Oct 30, 2002
24
US
Is there a way write VBA code in Word that will change the font for All styles of a document? Some of our users like to use the Times New Roman font for their documents, while others use Arial.
 
Hi carolfish,

Most styles are usually based on Normal. If you change the font in the Normal style you will probably find it propagates through other styles.

If that doesn't work, it should be possible to write some code to run through all the styles. It's not something I've done but if you do need it, ask and I'll try.

Enjoy,
Tony
 
When I change Normal, the Header, Footer and Page Number styles do not change. There may be others that do not change, but those are the ones I am aware of. It would be very helpful if you could write a code that would run through all styles. I don't need it to change anything but the font. Thanks.
 
Before putting Tony to that task, could you evaluate if you can simply make those three styles "based on" normal, so that they too will change when the normal font is changed?


Rob
[flowerface]
 
Okay; when I make sure that the Header and Footer styles are based on Normal, the font DOES change for these styles when I change the font in Normal. However, the Page Number style is based on the Default Paragraph Font, and when I attempt to click "Modify" to see what the Paragraph Font style is based on, "Modify" is grayed out. Also, some of the styles I created (which I based on Normal) do not change.
 
Hi carolfish,

Page Number is a text style NOT a paragraph style, and Default Paragraph Font should be set to "Font of the underlying paragraph", so what style is the paragraph in which you put your page number?

ENjoy,
Tony
 
I am putting my page number in the document's footer (Footer style). After I base my Footer style on Normal and change the Normal style, I see that it has now changed the page number's font as well (although I did not think it had because it still displays in the Styles and Formatting pane as being in another font. So that's resolved.

Now, as to why the fonts in some of the styles I created and based on Normal do not change, I figured this one out, too: Those styles were created in a template stored in the Startup folder, so I would need to edit the Normal style in the TEMPLATE document to change these fonts. Am I right?
 
Hi carolfish,

Yes, changing styles in normal.dot will not affect other templates (nor any styles that are stored in documents) - you need to do them all separately.

Enjoy,
Tony

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top