SectionProperties.AddSection 无法正常工作 - bug?
我刚刚遇到了SectionProperties.AddSection 的错误行为。假设我已经创建了四个部分:
1. Default
2. Overview
3. Details
4. Conclusions
现在我调用代码:
Presentation.SectionProperties.AddSection(3, "Overview details");
根据文档: SectionProperties.AddSection 方法 (PowerPoint) 概述详细信息 部分应在详细信息部分之前创建。
没有得到
1. Default
2. Overview
3. Overview Details
4. Details
5. Conclusions
但我最终
1. Default
2. Overview details
3. Overview
4. Details
5. Conclusions
答案:这是一个常见问题吗?我做了一些测试,似乎只有在开头或结尾插入新部分时,插入新部分才能正常工作。
谢谢, 帕韦乌
I've just came across a buggy behaviour of SectionProperties.AddSection. Let's say I have four sections already created:
1. Default
2. Overview
3. Details
4. Conclusions
And now I call a code:
Presentation.SectionProperties.AddSection(3, "Overview details");
According to the documentation: SectionProperties.AddSection Method (PowerPoint) Overview Details section should be created before Details section.
But instead of getting
1. Default
2. Overview
3. Overview Details
4. Details
5. Conclusions
I end up with:
1. Default
2. Overview details
3. Overview
4. Details
5. Conclusions
Is it a common issue? I did some testing and it seems that inserting new sections works properly only when new section is inserted at the beginning or end.
Thanks,
Paweł
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 MS Answers 上也看到了您的帖子,在这之间,有更多的时间来研究这个。这确实有问题,但有一个解决方法。当某些部分没有幻灯片时会出现此问题;因此,我们将向任何没有幻灯片的部分添加幻灯片,根据需要添加该部分,然后删除刚刚添加的“虚拟”幻灯片。
我将幻灯片添加到索引 1 处,然后将它们移动到需要它们的部分的开头。也许有一种方法可以将它们直接添加到该部分,但我找不到。
Saw your post on MS Answers as well and in between, had a bit more time to play with this. It's indeed buggy, but there's a workaround. The problem occurs when there are no slides in some sections; so we'll add slides to any sections that don't have them, add the section as needed, then delete the just-added "dummy" slides.
I'm adding the slides at index 1 then moving them to the start of the section where they're needed. Perhaps there's a way to add them directly to the section, but I couldn't find it.