Slides
Sequence of slides belonging to a presentation. Has list semantics for access to individual slides. Supports indexed access,len(), and iteration.
Accessed via the slides property of a Presentation object.
Methods
add_slide()
Return a newly added slide that inherits layout from the specified slide layout.The slide layout to use for the new slide
The newly created slide object
get()
Return the slide identified by integerslide_id in this presentation.
The unique slide ID to search for
Value to return if slide is not found
The slide with the specified ID, or
default if not foundindex()
Return the zero-based position of the specified slide in this slide sequence.The slide to locate in the collection
Zero-based index of the slide
ValueError if the slide is not in the collection.
Slide
Slide object providing access to shapes and slide-level properties.Properties
background
_Background - Background object providing slide background properties.
This property returns a _Background object whether or not the slide has an explicitly defined background. The same object is returned on every call.
follow_master_background
bool - True if this slide inherits the slide master background. Read/write.
Assigning False interrupts background inheritance from the master; if there is no custom background for this slide, a default background is added. If a custom background already exists, assigning False has no effect.
Assigning True causes any custom background for this slide to be deleted and inheritance from the master restored.
has_notes_slide
bool - True if this slide has a notes slide, False otherwise.
Use this property to test for a notes slide without the side effect of creating one.
name
str - String representing the internal name of this slide. Read/write.
Returns an empty string ('') if no name is assigned. Assigning an empty string or None causes any name to be removed.
notes_slide
NotesSlide - The notes slide instance for this slide.
If the slide does not have a notes slide, one is created. The same single instance is returned on each call.
placeholders
SlidePlaceholders - Sequence of placeholder shapes in this slide.
shapes
SlideShapes - Sequence of shape objects appearing on this slide.
slide_id
int - Integer value that uniquely identifies this slide within this presentation.
The slide id does not change if the position of this slide in the slide sequence is changed by adding, rearranging, or deleting slides.
slide_layout
SlideLayout - Slide layout object this slide inherits appearance from.
SlideLayout
Slide layout object providing access to placeholders, regular shapes, and slide layout-level properties.Properties
background
_Background - Background object providing slide layout background properties.
name
str - String representing the internal name of this slide layout. Read/write.
placeholders
LayoutPlaceholders - Sequence of placeholder shapes in this slide layout.
Placeholders appear in idx order.
shapes
LayoutShapes - Sequence of shapes appearing on this slide layout.
slide_master
SlideMaster - Slide master from which this slide layout inherits properties.
used_by_slides
tuple[Slide, ...] - Tuple of slide objects based on this slide layout.
SlideLayouts
Sequence of slide layouts belonging to a slide master. Supports indexed access,len(), iteration, index() and remove().
Methods
get_by_name()
Return the slide layout object having the specified name.Name of the slide layout to find
Value to return if layout is not found
The layout with the specified name, or
default if not foundindex()
Return the zero-based index of the specified slide layout in this collection.The slide layout to locate
Zero-based index of the layout
ValueError if the slide layout is not in the collection.
remove()
Remove the specified slide layout from the collection.The slide layout to remove
ValueError when the slide layout is in use. A slide layout which is the basis for one or more slides cannot be removed.
SlideMaster
Slide master object providing access to slide layouts, placeholders, regular shapes, and slide master-level properties.Properties
background
_Background - Background object providing slide master background properties.
name
str - String representing the internal name of this slide master. Read/write.
placeholders
MasterPlaceholders - Collection of placeholder shapes in this master, sorted in idx order.
shapes
MasterShapes - Sequence of shape objects appearing on this slide master.
slide_layouts
SlideLayouts - Collection of slide layouts belonging to this slide master.
SlideMasters
Sequence of slide master objects belonging to a presentation. Has list semantics supporting indexed access,len(), and iteration.
NotesSlide
Notes slide object providing access to slide notes placeholder and other shapes on the notes page.Properties
background
_Background - Background object providing notes slide background properties.
name
str - String representing the internal name of this notes slide. Read/write.
notes_placeholder
NotesSlidePlaceholder | None - The notes placeholder on this notes slide.
This is the shape that contains the actual notes text. Returns None if no notes placeholder is present (uncommon).
notes_text_frame
TextFrame | None - The text frame of the notes placeholder on this notes slide.
Returns None if there is no notes placeholder. This is a shortcut for the common case of simply adding notes text to the notes page.
placeholders
NotesSlidePlaceholders - Sequence of placeholder shapes in this notes slide.
shapes
NotesSlideShapes - Sequence of shape objects appearing on this notes slide.