Font.AllCaps property (Publisher)

Returns or sets msoTrue if the font is formatted as all capital letters, or returns one of the other MsoTriState constants if it is not. Read/write.

Syntax

expression.AllCaps

expression A variable that represents a Font object.

Return value

MsoTriState

Remarks

Setting the AllCaps property to msoTrue sets the SmallCaps property to msoFalse, and vice versa.

The AllCaps property value can be one of the MsoTriState constants declared in the Microsoft Office type library.

Example

This example checks the selected text in the active document for text formatted as all capital letters. For this example to work, there must be an active publication with text selected.

Public Sub Caps() 
 
 If Publisher.ActiveDocument.Selection _ 
 .TextRange.Font.AllCaps = msoTrue Then 
 MsgBox "Text is all caps." 
 Else 
 MsgBox "Text is not all caps." 
 End If 
 
End Sub

This example formats the selected text as all capital letters. For this code to execute properly, an active document must exist with selected text.

Public Sub MakeCaps() 
 
 If Publisher.ActiveDocument.Selection.TextRange _ 
 .Font.AllCaps = msoFalse Then 
 Selection.TextRange.Font.AllCaps = msoTrue 
 Else 
 MsgBox "You need to select some text or it is already all caps." 
 End If 
 
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.