Subscript Property

Microsoft Word Visual Basic

Subscript Property

       

True if the font is formatted as subscript. Returns True, False or wdUndefined (a mixture of True and False). Can be set to True, False, or wdToggle. Read/write Long.

expression.Subscript

expression   Required. An expression that returns a Font object.

Remarks

Setting the Subscript property to True sets the Superscript property to False, and vice versa.

Example

This example inserts text at the beginning of the active document and formats the tenth character as subscript.

Set myRange = ActiveDocument.Range(Start:=0, End:=0)
myRange.InsertAfter "Water = H20"
myRange.Characters(10).Font.Subscript = True

This example checks the selected text for subscript formatting.

If Selection.Type = wdSelectionNormal Then
    mySel = Selection.Font.Subscript
    If mySel = wdUndefined Or mySel = True Then
        MsgBox "Subscript text exists in the selection."
    Else
        MsgBox "No subscript text in the selection."
    End If
Else
    MsgBox "You need to select some text."
End If