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

PPTools

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

Merge Excel, CSV or tab-delimited data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

FixLinks prevents broken links when you distribute PowerPoint presentations

Optimizer saves disk space and bandwidth, shrinks your PowerPoint presentations to the right size for email, screenshow or printing

PPT2HTML gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Prep4PDF preserves interactivity in PowerPoint presentations when you convert to PDF

Image Export converts PowerPoint slides to JPG, PNG, GIF, WMF and more

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.

Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2009 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.
Español    Deutsch    Français    Português    Italiano    Nederlands    Greek    Japanese    Korean    Chinese

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.htm
Last update 09 January, 2009
Created: