fontStyle Property

Sets or returns a String that represents the font-style setting for an inline style attribute of a specified object.

expression.fontStyle

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

The String value for the fontStyle property can be one of the following:

normal Font is normal. Default.
italic Font is italic.
oblique Font is italic.

Example

This example inserts a new paragraph containing the current user's name into the active document, and then formats the font characteristics.

Sub FontFaceSource()
    Dim objPara As FPHTMLParaElement

    ActiveDocument.body.insertAdjacentHTML where:="beforeend", _
            HTML:="<p id=""username"">" & Application.UserName & "</p>"

    Set objPara = ActiveDocument.body.all.tags("p").Item("username")

    With objPara.Style
        .fontFamily = "Tahoma"
        .FONTSIZE = "40pt"
        .fontStyle = "italic"
        .fontVariant = "small-caps"
        .fontWeight = "bold"
    End With
End Sub

Applies to | FPHTMLStyle Object | IFPStyleState Object | IHTMLRuleStyle Object | IHTMLStyle Object