Italic Property

Microsoft Publisher Visual Basic

constant indicating whether the specified text is formatted as italic. Read/write.

MsoTriState can be one of these MsoTriState constants.
msoCTrue Not used with this property.
msoFalse None of the characters in the range are formatted as italic.
msoTriStateMixed Return value indicating a combination of msoTrue and msoFalse for the specified text.
msoTriStateToggle Set value which toggles between msoTrue and msoFalse.
msoTrue All of the characters in the range are formatted as italic.

expression.Italic

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

Example

This example tests all the text in the second story of the active publication and if it has mixed italics, it sets all the text to italic. If the text is all italic or not italic, a message is dispalyed informing the user there are no mixed italics.

Sub ItalicStory()

    Dim stf As Font

    Set stf = Application.ActiveDocument.Stories(2).TextRange.Font
    With stf
        If .Italic = msoTriStateMixed Then
            .Italic = msoTrue
        Else
            MsgBox "There are no mixed italics in this story."
        End If
    End With

End Sub