Underline Property

Microsoft PowerPoint Visual Basic

Underline Property

       

Determines whether the specified text (for the Font object) or the font style (for the FontInfo object) is underlined. Read/write MsoTriState.

MsoTriState can be one of these MsoTriState constants.
msoCTrue
msoFalse The specified text (or font style) isn't underlined.
msoTriStateMixed Some characters are underlined (for the specified text) and some aren't. 
msoTriStateToggle
msoTrue The specified text (or font style) is underlined.

expression.Underline

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

Example

This example sets the formatting for the text in shape two on slide one in the active presentation.

With Application.ActivePresentation.Slides(1).Shapes(2)
    With .TextFrame.TextRange.Font
        .Size = 32
        .Name = "Palatino"
        .Underline = msoTrue
    End With
End With