VBA & Macro Problems

How to Apply Theme Body and Heading Fonts in PowerPoint VBA

Algirdas JasaitisAlgirdas Jasaitis Oct 28, 2026 868 views

Question details

The user wants to link shape fonts to the presentation theme (Body/Heading) using VBA so the fonts update automatically when the presentation's design template changes.

How to Apply Body and Heading Theme Fonts in PowerPoint VBA
Product
PowerPoint
Device & OS
not provided
Scenario
Automating font formatting via VBA to ensure text elements remain compatible with dynamic design templates and font schemes.
Observed behavior
Shapes are currently hardcoded with direct font names like Arial, which prevents them from updating automatically when a new design template or font scheme is applied.
Before you start

Ensure you have enabled the Developer tab in your presentation software to access the VBA editor, and save a backup of your current presentation before running any macro scripts.

Solution 1Recommended

Set Theme Fonts Using VBA Strings

Use specific VBA identifiers to link your text shapes directly to the presentation's theme font scheme instead of hardcoding the font name.

In VBA, presentation themes use special internal strings to denote theme fonts. Instead of assigning a static font name like 'Arial', you assign these strings to the Font.Name property to link the text to the active theme.

1
Open the VBA Editor

Press Alt + F11 to launch the Visual Basic for Applications editor in your presentation program.

2
Target the Text Range

In your macro module, write code to specify the shape or text range you want to modify (e.g., ActiveWindow.Selection.ShapeRange(1).TextFrame.TextRange).

3
Apply the Heading Font

Set the font name property to "+mj-lt" to apply the Major Latin font used for headings. Example: .Font.Name = "+mj-lt"

4
Apply the Body Font

Set the font name property to "+mn-lt" to apply the Minor Latin font used for body text. Example: .Font.Name = "+mn-lt"

Dynamic Updates Enabled: By using +mj-lt and +mn-lt instead of hardcoded font names, your text will automatically update its typeface whenever you apply a new theme or font scheme to the presentation.
WPS Presentation

Manage Presentation Themes and Fonts Seamlessly with WPS Office

WPS Presentation offers intuitive tools to manage slide masters, theme fonts, and layouts without needing complex VBA code. Create dynamic, professional slides effortlessly while maintaining full compatibility.

  1. 1. Open your presentation: Launch WPS Office and open your existing presentation file.
  2. 2. Choose a Design Theme: Navigate to the Design tab to select from a variety of pre-set, professional themes.
  3. 3. Modify the Slide Master: Go to the View tab and select Slide Master to customize fonts for headings and body text globally across all slides.
  4. 4. Apply and Save: Close the Master View to see all your slides update automatically, then save your perfectly formatted document.
Fully compatible with Microsoft PowerPoint (.pptx) files and templates.Built-in Slide Master for bulk font, color, and layout adjustments.Rich library of free, professionally designed presentation templates.Lightweight architecture that runs smoothly on older computers and laptops.
microsoft office alternative - wps office

Frequently Asked Questions

What do +mn-lt and +mj-lt mean in PowerPoint VBA?

These are internal Office identifiers for theme fonts. '+mn-lt' stands for Minor Latin, which is linked to the theme's body text font. '+mj-lt' stands for Major Latin, which is linked to the theme's heading font.

Why is my VBA macro applying Times New Roman instead of the theme font?

This usually happens if the font name string is typed incorrectly or if the theme font scheme is missing or corrupted. Double-check that your VBA code uses exactly "+mn-lt" or "+mj-lt" including the plus sign.

Can I apply theme fonts to only specific slides using VBA?

Yes. You can loop through the shapes on a specific Slide object in your VBA code and apply the theme font strings to the TextRange.Font.Name property of only those specific shapes.

Will hardcoded fonts override the presentation theme?

Yes. If you manually set a shape's font to a specific name like 'Arial' via the ribbon or VBA, it breaks the dynamic link to the theme. You must reassign the font using the theme identifiers to restore dynamic updates.