General discussion

Locked

Word heading style number font name

By CannotUnsubscribe ·
I would be grateful if someone could help with this before I go completely insane. What I want to do is obtain the name of the font used for the number in a heading style (e.g. "Heading 1").

'With this, I can get the font properties of heading style text

With ActiveDocument.Styles("heading 1")
With .Font
MsgBox (.Name)
'...
End With
End With


'With this, I can get non-font properties of heading style numbers

With ListGalleries(wdOutlineNumberGallery).ListTemplates(1).ListLevels(1)
MsgBox (.StartAt)
'...
End With


'Using the same successful calls and syntax used in the examples above, I can get font properties of heading style numbers except for the font name. Am I doing something stupid here is Word known not to reveal what I seek?

With ListGalleries(wdOutlineNumberGallery).ListTemplates(1).ListLevels(1)
With .Font
MsgBox (.Name)
MsgBox (.Italic)
'...
End With
End With

Thanks.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by ctrservices In reply to Word heading style number ...

Not sure I know what you mean. If the following is not what you want, post a comment to let me know.

Whenever you open Word in the default mode, the Styles and Formatting box on the Formatting toolbar shows Normal. Click the down arrow by Normal (12 pt type, Times New Roman). Select Heading 1, and it now shows that for Heading 1 you now have 16 pt Arial type font.

Obviously this works for any type of font you are using.

Collapse -

by CannotUnsubscribe In reply to

Thanks but what I want to do is obtain (via VBA) the properties stored in the heading style for the number set in the style.

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums