PowerPoint.InsertSlideFormatting enum

指定插入幻灯片时的格式设置选项。

注解

[ API 集: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 = context.presentation;
    const selected = 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"

将源主题复制到目标演示文稿并使用该主题。

useDestinationTheme = "UseDestinationTheme"

在目标演示文稿中使用现有主题。