When you use an existing PowerPoint® presentation as a template for a PPT API presentation, the content from the template presentation appears in the new PPT API presentation. You can use the PPT API to update content in the existing presentation. You can also programmatically change some formatting of the content that you are updating.
To format a PPT API presentation that you create completely
programmatically, specify an empty PowerPoint presentation as
a template when you create a Presentation
object.
You can use the default PPT API PowerPoint template as a starting point for a your own template.
You can use a similar approach to customize a PowerPoint template
other than the default PPT API template. To do so, when you create
a Presentation
object, specify the template that
you want to customize.
In a PPT API program, create an empty Presentation
object,
without specifying a template. The PPT API uses the default PowerPoint template.
Generate the presentation.
Open the presentation and make changes to the template elements.
Save the presentation using a different name. Using a different name prevents you from overwriting it with the default template.
Use the new template with a PPT API presentation.
For example, if the customized template is called myTemplate
,
then use myTemplate
when you create a PPT API presentation:
newPresentation = Presentation('mySecondPresentation','myTemplate');
To specify formatting to apply throughout a presentation, use a slide master. The formatting in a slide master is the default formatting for all its child slide layouts.
In PowerPoint, open a template or a presentation that you want to use as a template.
In the View tab, in the Master Views section, click Slide Master. For example, using the default PPT API template:
In a slide master, click in a placeholder. For example, in the master title slide, click in Click to edit Master title style text and select a formatting option, such as changing the font color to red.
Save the template.
You can add a slide master to a PowerPoint template. Adding a slide master is useful for providing different formatting for different parts of a presentation.
Interactively open the PowerPoint template.
In the View tab, in the Master Views section, click Slide Master.
In the slide master and layout pane, click after the last slide layout.
Right-click and select Insert Slide Master. A new slide master appears, with a copy of the slide layouts under it.
Format the new slide master.
Give the slide master a meaningful name. (By default PowerPoint names
new masters Custom Design
, 1_Custom Design
, 2_Custom
Design
, and so on.) In the Slide Master tab,
in the Edit Master section, click Rename and
follow the prompts.
Save the template.
To specify formatting to apply to a specific kind of slide, use a slide layout.
In PowerPoint, open a template or a presentation that you want to use as a template.
In the View tab, in the Master Views section, click Slide Master.
From the slide masters and layout pane, select the slide layout whose formatting you want to change. For example, in the default PPT API PowerPoint template, click the Title and Content slide layout.
To see the name of a slide layout, hover over that layout. A tooltip appears with the name of the slide layout and the number of slides that use that slide layout.
In a slide master, click in a placeholder whose formatting you want to change. For example, in the default PPT API template, in the Title and Content slide layout, click in Click to edit Master title style. Select a formatting option, such as changing the font color to red. The change applies to the title of that slide layout, but not to the title of other slide layouts.
Save the template.
You can add a slide layout to a PowerPoint template.
Interactively open the PowerPoint template that you want to modify.
In the View tab, in the Master Views section, click Slide Master.
In a slide layout, right-click and select Insert Layout. A new slide layout appears, with a title placeholder.
To create a slide layout based on an existing slide layout, right-click in the slide layout that you want to base the layout on. Then select Duplicate Layout.
Customize the layout. For example, you can change the font for an existing placeholder or add a placeholder, such as a table placeholder. You can interactively set the location and size of the table placeholder. To remove or add title and footers, use the Title and Footers check boxes in the Slide Master tab.
Give the slide layout a meaningful name. (By default PowerPoint names
new layouts Custom Layout
, 1_Custom Layout
, 2_Custom
Layout
, and so on.) In the Slide Master tab,
in the Edit Master section, click Rename and
follow the prompts.
Save the template.
You can add any type of placeholder to any slide layout. However, using the PPT API, you can replace this subset of placeholders:
Content
Text
Picture
Table
Interactively open the PowerPoint template that you want to modify.
In the View tab, in the Master Views section, click Slide Master.
In the slide layout pane, select the slide layout to add the placeholder to.
In the Slide Master tab, in the Master Layout section, click Insert Placeholder and select the type of placeholder from the list. For example, in the default PPT API template, add a Table placeholder to the Blank slide layout.
In the slide layout, size and position the placeholder.
Name the placeholders that you want to use when you add or replace content with the PPT API. To name a placeholder, first display the Selection pane. On the Home tab, in the Editing section, select Select > Selection Pane. In the Selection pane, click the placeholder name and type a new one.
Save the template.