Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

Proud member of

PPTools

Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Working with text in PowerPoint 2007 (VBA)

How can I set a font to the Heading or Body font style?

You can manually select any font you like for text, or you can select the font associated with the current font theme for Headings or Body. For example, by default, in a new presentation, the headings (titles) will be set to "Calibri (Headings)" rather than just Calibri.

This tells you that if you change to a different Font theme, the text will take on whatever font is assigned to Headings for that theme

But what if you want to assign the Headings or Body style to some text programmatically? Here's the trick (as yet undocumented; thanks to our friends at Microsoft for supplying this information):

To assign a Headings (major) or Body (minor) font style to text, you change the font name to this:

"+" & FontType & "-" & FontLang

FontType:

FontLang:

So to change all of the selected shapes on a slide to the Major/Headings typeface for Latin text:

Sub Example()
    Dim osh As Shape
    For Each osh In ActiveWindow.Selection.ShapeRange
        With osh
            With .TextFrame.TextRange
                .Font.Name = "+mj-lt"
            End With
        End With
    Next
End Sub

After selecting some shapes that include text and running this, go to the Design tab and change the Fonts themes. Note that each of the changed text box fonts will change to as you change font themes.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2022 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Working with text in PowerPoint 2007 (VBA)
http://www.pptfaq.com/FAQ00957_Working_with_text_in_PowerPoint_2007_-VBA-.htm
Last update 07 June, 2011
Created: