Bewerken

Delen via


Font.SubScript property (Publisher)

Returns or sets an MsoTriState constant indicating whether characters are formatted as subscript in the specified text range. Read/write.

Syntax

expression.SubScript

expression A variable that represents a Font object.

Return value

MsoTriState

Remarks

The SubScript property value can be one of the MsoTriState constants declared in the Microsoft Office type library and shown in the following table.

Constant Description
msoFalse No characters in the range are formatted as subscript.
msoTriStateMixed A return value indicating a combination of msoTrue and msoFalse for the specified shape range.
msoTriStateToggle A set value that switches between msoTrue and msoFalse.
msoTrue All characters in the range are formatted as subscript.

Setting the SubScript property to msoTrue removes superscript formatting from the text range.

Example

This example tests the text in the second story, and if it has mixed subscripting, it formats all the text as subscript.

Sub SubScript() 
 
 Dim fntSS As Font 
 
 Set fntSS = Application.ActiveDocument.Stories(2).TextRange.Font 
 With fntSS 
 If .SubScript = msoTriStateMixed Then 
 .SubScript = msoTrue 
 Else 
 MsgBox "Mixed subscript not in this story." 
 End If 
 End With 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.