font Property
Sets or returns a String that represents up to six separate font properties for the specified object.
expression.font
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
The String value for the font property can be up to six of the space-delimited values listed in the following table, plus one or more of the additional values shown below them:
font-style |
Any of the range of font-style values available to the fontStyle property. |
font-variant |
Any of the range of font-variant values available to the fontVariant property. |
font-weight |
Any of the range of font-weight values available to the fontWeight property. |
font-size |
Any of the range of font-size values available to the fontSize property. |
line-height |
Any of the range of line-height values available to the lineHeight property. |
font-family |
Any of the range of font-family values available to the fontFamily property. |
Additional values
The additional values specify font formatting according to the user's system settings. For example, setting the font property to "menu" will display the affected text using the font formatting the user has specified for menus. The following example displays all text in the body of the active document using the font formatting defined for icon labels on the user's desktop.
ActiveDocument.body.Style.Font = "icon"
caption |
Text font used in objects that have captions (buttons, labels, and so on). |
icon |
Text font used in icon labels. |
menu |
Text font used in menus. |
messagebox |
Text font used in dialog boxes. |
smallcaption |
Text font used in small controls. |
statusbar |
Text font used in window status bars. |
Example
The following example sets the font characteristics for the body of the active document
ActiveDocument.body.Style.Font = "italic 12pt bold tahoma"