首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Powerpoint如何将幻灯片插入区段

Powerpoint如何将幻灯片插入区段
EN

Stack Overflow用户
提问于 2017-03-21 13:15:12
回答 1查看 657关注 0票数 0

我正在开发一个Powerpoint插件,它有助于创建议程幻灯片。我必须在一个特定的位置插入一张幻灯片,这很容易使用presentation.Slides.AddSlide(索引,自定义布局)。但是,由于我也在使用区段,所以这总是在第一个(默认)部分中插入幻灯片。

这里是一个示例结构。我想在第1页的当前位置替换它。为此,我需要在slideIndex=2插入一个幻灯片,但就目前的情况而言,幻灯片将在“标题页”下面结束。

  • 默认区段
    • 页眉页

  • 第1节
    • 第1页
    • 第2页

下面是一些我正在使用的代码

代码语言:javascript
运行
复制
private static PPT.Slide RefreshDefaultAgendaFormat(PPT.Presentation presentation, PPT.CustomLayout customAgendaLayout, PPT.Slide currentSlide)
    {
        int tempindex = currentSlide.SlideIndex;
        int tempSectionIndex = currentSlide.sectionIndex;

        currentSlide.Delete();
        currentSlide = presentation.Slides.AddSlide(tempindex, customAgendaLayout);

        return currentSlide;
    }
EN

回答 1

Stack Overflow用户

发布于 2017-03-23 14:10:26

我通过更改操作顺序并在当前的index+1中添加操作来解决这个问题。

代码语言:javascript
运行
复制
    int tempindex = currentSlide.SlideIndex;
    int tempSectionIndex = currentSlide.sectionIndex;
    PPT.Slide newSlide = presentation.Slides.AddSlide(tempindex + 1, customAgendaLayout);
    currentSlide.Delete();
    return newSlide;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42928261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档