Placeholder Objects
Placeholder shapes are a special type of shape that inherit properties from their layout or master placeholders. They provide distinct behaviors depending on whether they appear on a slide, layout, or master.SlidePlaceholder
A placeholder shape on a slide that inherits properties from its corresponding slide layout placeholder.Properties
Always returns
True for placeholder shapes.Returns
MSO_SHAPE_TYPE.PLACEHOLDER.The effective left position of this placeholder. Returns the directly-applied left if it has one, otherwise inherits from the layout placeholder.
The effective top position of this placeholder. Returns the directly-applied top if it has one, otherwise inherits from the layout placeholder.
The effective width of this placeholder. Returns the directly-applied width if it has one, otherwise inherits from the layout placeholder.
The effective height of this placeholder. Returns the directly-applied height if it has one, otherwise inherits from the layout placeholder.
ChartPlaceholder
A placeholder shape that can only accept a chart.Methods
Insert a chart into this placeholder.Parameters:
chart_type(XlChartType): One of the XL_CHART_TYPE enumeration valueschart_data(ChartData): A ChartData object populated with categories and series values
.chart property.PicturePlaceholder
A placeholder shape that can only accept a picture.Methods
Insert a picture into this placeholder.Parameters:
image_file(str | file-like): Path to image file or a file-like object
TablePlaceholder
A placeholder shape that can only accept a table.Methods
Insert a table into this placeholder.Parameters:
rows(int): Number of rows in the tablecols(int): Number of columns in the table
.table property.Example:LayoutPlaceholder
A placeholder shape on a slide layout that inherits shape properties from the master placeholder of the same type.Properties
Inherits all properties from_InheritsDimensions including left, top, width, and height.
MasterPlaceholder
A placeholder shape on a slide master.Properties (Deprecated)
Integer placeholder index attribute.
Placeholder type, e.g.
PP_PLACEHOLDER.CENTER_TITLE.Placeholder orientation, e.g.
ST_Direction.HORZ.Placeholder size attribute, e.g.
ST_PlaceholderSize.FULL.PlaceholderGraphicFrame
A placeholder shape populated with a table, chart, or smart art.Properties
Always returns
True.The Chart object contained in this graphic frame (if it contains a chart).
The Table object contained in this graphic frame (if it contains a table).
PlaceholderPicture
A placeholder shape populated with a picture. Inherits dimensions from its layout placeholder.Properties
Inherits all properties from bothPicture and _InheritsDimensions.
Returns
MSO_SHAPE_TYPE.PLACEHOLDER instead of MSO_SHAPE_TYPE.PICTURE.