Slides, Layouts, and Masters
Witan models normal PowerPoint inheritance: a slide can inherit visuals, placeholders, backgrounds, and theme colors from its layout and master.
Layouts
Read a slide's layout:
const slide = context.presentation.slides.getItemAt(0);
slide.layout.load("id,name,type");
await context.sync();
return slide.layout.toJSON();
Apply a different layout:
const slide = context.presentation.slides.getItemAt(0);
const layout = context.presentation.slideMasters.getItemAt(0).layouts.getItemAt(1);
slide.applyLayout(layout);
await context.sync();
Backgrounds
Set a slide background:
const slide = context.presentation.slides.getItemAt(0);
slide.background.fill.setSolidFill({ color: "#F7F8FA" });
Supported background fills include solid, gradient, pattern, and picture/texture fills. Layout and master backgrounds expose similar fill surfaces.
Theme colors
Slides, layouts, and masters expose scoped theme color schemes. Use Themes and Color Schemes for inheritance rules, supported slots, and read/write examples.
Placeholders
Shapes expose placeholderFormat when they are placeholder-backed. Common placeholder kinds include title, body, content, table, chart, picture, slide image, date, footer, header, and slide number.