Table of contents
TOC
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.

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 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
© 2018 Microsoft