Apply Small Caps in PowerPoint with a VBA Macro
Question details
The user wants a VBA macro that applies Small Caps to selected text or text in a selected text box.
- Product
- Microsoft PowerPoint
- Device & OS
- not provided
- Scenario
- The user wants a convenient command for formatting presentation text as Small Caps.
- Observed behavior
- The desired result is selected text displayed in Small Caps without repeatedly opening the Font dialog.
Open the presentation in a desktop version of PowerPoint that supports VBA. Save it as a macro-enabled presentation (.pptm) or macro-enabled template (.potm) so the macro can be retained.
Create a Small Caps macro and add it to the Quick Access Toolbar
Use this macro to apply Small Caps to a text selection or to all text in one selected text box.
In desktop PowerPoint, press Alt+F11 to open the Visual Basic Editor. Select the presentation or template project in the Project Explorer.
Choose Insert > Module and paste this code: Sub MySmallCaps() Dim sel As Selection Set sel = ActiveWindow.Selection If sel.Type = ppSelectionText Then sel.TextRange2.Font.SmallCaps = msoTrue ElseIf sel.Type = ppSelectionShapes Then If sel.ShapeRange.Count = 1 Then If sel.ShapeRange(1).HasTextFrame = msoTrue Then If sel.ShapeRange(1).TextFrame2.HasText = msoTrue Then sel.ShapeRange(1).TextFrame2.TextRange.Font.SmallCaps = msoTrue End If End If End If End If End Sub
Save the file as .pptm or .potm. In PowerPoint, select the text or one text box, open View > Macros, select MySmallCaps, and choose Run.
Open File > Options > Quick Access Toolbar. Under Choose commands from, select Macros, choose MySmallCaps, click Add, and then click OK.

Work with PowerPoint presentations in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with presentations and other Office files. Its format compatibility can make switching between Office suites easier, though it does not fix PowerPoint's VBA settings or guarantee that PowerPoint macros will run.

Frequently Asked Questions
Does the macro format the whole text box or just selected text?
If you select text within a text box, it formats only that selection. If you select one text box as a shape, it formats all the text in that box.
Why can't I find the macro after reopening my presentation?
Make sure you saved the code in a macro-enabled .pptm presentation or .potm template and that the file containing the macro is open. A standard .pptx file cannot retain VBA macros.
Can I use this VBA macro in PowerPoint for the web?
No. Open the file in a desktop version of PowerPoint that supports VBA to edit and run the macro.
Will a macro saved in a template be available in every presentation?
Not necessarily. The template or another file containing the macro must be available to PowerPoint; saving a macro in a template alone does not guarantee global availability.




