Font.SuperScript property (Publisher)
Returns or sets an MsoTriState constant indicating whether characters are formatted as superscript in the specified text range. Read/write.
Syntax
expression.SuperScript
expression A variable that represents a Font object.
Return value
MsoTriState
Remarks
The SuperScript 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 superscript. |
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 superscript. |
Setting the SuperScript property to msoTrue removes subscript formatting from the text range.
Example
This example tests the text in the second story, and if it has mixed superscripting, it formats all the text as superscript.
Sub SuperScript()
Dim fntSuper As Font
Set fntSuper = Application.ActiveDocument.Stories(2).TextRange.Font
With fntSuper
If .SuperScript = msoTriStateMixed Then
.SuperScript = msoTrue
Else
MsgBox "Mixed superscript 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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for