PowerPoint.InsertSlideFormatting enum
Specifies the formatting options for when slides are inserted.
[ API set: PowerPointApi 1.2 ]
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/slide-management/insert-slides.yaml
await PowerPoint.run(async function(context) {
// Get the ID of the first selected slide.
const presentation: PowerPoint.Presentation = context.presentation;
const selected: PowerPoint.Slide = presentation.getSelectedSlides().getItemAt(0);
selected.load("id");
await context.sync();
// Insert the other presentation after the selected slide.
const insertOptions: PowerPoint.InsertSlideOptions = {
formatting: PowerPoint.InsertSlideFormatting.useDestinationTheme,
targetSlideId: selected.id
};
presentation.insertSlidesFromBase64(chosenFileBase64, insertOptions);
await context.sync();
});
keepSourceFormatting = "KeepSourceFormatting" | Copy the source theme into the target presentation and use that theme. |
useDestinationTheme = "UseDestinationTheme" | Use the existing theme in the target presentation. |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins feedback
Office Add-ins is an open source project. Select a link to provide feedback: