Font.SmallCaps property (Publisher)

Returns or sets an MsoTriState constant indicating whether the specified text is formatted as small caps. Read/write.

Syntax

expression.SmallCaps

expression A variable that represents a Font object.

Return value

MsoTriState

Remarks

The SmallCaps 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 None of the characters in the range are formatted as small caps.
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 of the characters in the range are formatted as small caps.

Setting the SmallCaps property to msoTrue removes all caps formatting from the text range.

Example

This example tests the text in the second story, and if it has mixed small caps formatting, it formats all the text as small caps.

Sub SmallCap() 
 
 Dim fntSC As Font 
 
 Set fntSC = Application.ActiveDocument.Stories(2).TextRange.Font 
 With fntSC 
 If .SmallCaps = msoTriStateMixed Then 
 .SmallCaps = msoTrue 
 Else 
 MsgBox "Mixed small caps are 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.