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

Font.AllCaps Property (Publisher)

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

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.


expression. AllCaps

_expression_A variable that represents a Font object.

Return Value



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.


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 be an active publication with text selected.

Public Sub Caps() 

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

End Sub
© 2018 Microsoft