CreatePlaceholder
Creates a new placeholder.
Syntax
expression.CreatePlaceholder(sType);
expression
- A variable that represents a Api class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
sType | Required | string | The placeholder type ("body", "chart", "clipArt", "ctrTitle", "diagram", "date", "footer", "header", "media", "object", "picture", "sldImage", "sldNumber", "subTitle", "table", "title"). |
Returns
Example
This example shows how to create placeholder for shape.
- Code
- Result
// How to change a placeholder type of an object.
// Add a placeholder to the shape.
const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();
const fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
const stroke = Api.CreateStroke(0, Api.CreateNoFill());
const shape = Api.CreateShape("flowChartMagneticTape", 300 * 36000, 130 * 36000, fill, stroke);
shape.SetPosition(608400, 1267200);
shape.SetSize(300 * 36000, 130 * 36000);
const placeholder = Api.CreatePlaceholder("picture");
shape.SetPlaceholder(placeholder);
slide.AddObject(shape);