TextStyle Property

Microsoft Publisher Visual Basic

expression.TextStyle

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

Example

This example changes the text style of the selection if the selection isn't formatted with the Normal text style. This example assumes text is selected in the active publication.

Sub SetTextStyle()
    With Selection.TextRange.ParagraphFormat
        If .TextStyle <> "Normal" Then _
            .TextStyle = "Normal"
    End With
End Sub