Table of contents
TOC
Collapse the table of content
Expand the table of content

Font.SmallCaps Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

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.

ConstantDescription
msoFalseNone of the characters in the range are formatted as small caps.
msoTriStateMixedReturn value indicating a combination of msoTrue and msoFalse for the specified shape range.
msoTriStateToggleSet value that switches between msoTrue and msoFalse.
msoTrueAll 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
© 2018 Microsoft