PDA

View Full Version : Word 2007 Manage Styles



evamads
10-15-2009, 07:28 AM
Does anyone know how to write VBA-code til set the default font from the Styles Panel, the Manage Styles button, the Set Defaults tab?

/evamads

geekgirlau
10-15-2009, 05:14 PM
Selection.Font.SetAsTemplateDefault

evamads
10-16-2009, 12:42 AM
Thanks for the tip. This changes the Normal style and all styles based on Normal.

But when i go to the Styles Panel, the Manage Styles button, and the Set Defaults tab, the default style is still Times New Roman, so it does not change....

/eva

geekgirlau
10-18-2009, 09:18 PM
Hi eva,

OK, finally found the "Manage Styles" button.

Is it even relevant? Generally all styles in the document are based on Normal. For example, I have the font in the Normal style set to Verdana, but when I go into Manage Styles the default font is Times New Roman. However because Normal is set to Verdana, so is every other style in my standard template, including any new ones I create (as they must be based on another style).

I suspect that the purpose of this screen is for people who have no idea how to use the Normal style. I'm sure someone will correct me if I'm wrong, but I believe that if you have set your styles correctly you don't need to change anything in this screen at all.

evamads
10-19-2009, 09:29 AM
Hi qeekgurlau,

You are right, it is not relevant if all your styles are based on the Normal-style. But we have a lot of old templates (some of them converted from Word Pro), the styles are not based on the Normal-style. But when I change the style from the Manage Styles button, these styles change, and that is why I am looking for the VBA-code.

geekgirlau
10-19-2009, 04:53 PM
I haven't found any way of referring to Manage Styles, however we can tackle it in a different way.

This will update the font in every style in your document, without changing any other attributes (bold, size etc.).


Dim st As Style


For Each st In ActiveDocument.Styles
st.Font.Name = "Arial"
Next st

fumei
10-20-2009, 11:40 AM
geekgirlau: "Generally all styles in the document are based on Normal. "

Really?

I am the complete opposite. NONE of my styles are based on Normal. As styles have inheritance, I only ever use that inheritance when I deliberately want to use that inheritance.

Other than that (which does happen frequently 'tis true), all new styles are based on "no style".

So I create what I know will be a "Parent" style based on "no style", then yes, I will make child styles based on THAT style.

But all my top-level (and I am not refering to heading levels) styles are based on "no style", not Normal. I essentially never use Normal for anything.

geekgirlau
10-20-2009, 04:52 PM
Gerry, you're right - I should have been more specific.

The vast majority of the default styles are based on the Normal style. The handful that are not are based on other styles that are themselves based on Normal.

Of course this situation does not apply if you have created and setup your own styles. However in my experience in multiple corporate environments, I've seen very few styles not based on Normal.

Unfortunately poor use of styles is pretty rampant as you know ...

fumei
10-21-2009, 11:05 AM
"Unfortunately poor use of styles is pretty rampant as you know ..."


oh yes indeed

"However in my experience in multiple corporate environments, I've seen very few styles not based on Normal."

oh yes indeed indeed.

How many documents have you seen "Char Char" in the Style dropdown? Most.

Others: Word puts "Char Char" in the Style dropdown when there has been so much manual formatting that Word basically shrugs its shoulders and says "whatever"...or "Char Char".