如何在 PowerPoint 中管理幻灯片

This article was translated from English: Does it need improvement?
Translated
View the article in English

幻灯片是演示文稿中的单个页面或屏幕。 它是组织和展示内容的基本构建块。 幻灯片用于以视觉方式传达信息,可以包括文本、图像、图表、表格、视频、音频、动画和其他设计元素。

在 PowerPoint 演示文稿中管理幻灯片涉及添加、重新排序、编辑、删除和隐藏幻灯片,以有效地构建内容。

开始使用IronPPT

立即在您的项目中开始使用IronPPT,并享受免费试用。

第一步:
green arrow pointer


添加幻灯片

使用 AddSlide 方法轻松地为演示文稿添加新幻灯片。 新幻灯片会添加到当前幻灯片列表的末尾,使您能够无缝地扩展您的演示。

:path=/static-assets/ppt/content-code-examples/how-to/manage-slide-add-slide.cs
using IronPPT;

var document = new PresentationDocument();

// Add slides
document.AddSlide();
document.AddSlide();
document.AddSlide();

document.Save("addSlides.pptx");
Imports IronPPT

Private document = New PresentationDocument()

' Add slides
document.AddSlide()
document.AddSlide()
document.AddSlide()

document.Save("addSlides.pptx")
VB   C#

移除幻灯片

使用 Remove 方法删除不需要的幻灯片。 此功能确保您可以快速完善内容并删除不必要的幻灯片,而不破坏整体结构。

提示
所有幻灯片索引位置均遵循从零开始的索引。

:path=/static-assets/ppt/content-code-examples/how-to/manage-slide-remove-slide.cs
using IronPPT;

var document = new PresentationDocument();

document.AddSlide();

// Remove slide
document.Slides[0].Remove();

document.Save("removeSlide.pptx");
Imports IronPPT

Private document = New PresentationDocument()

document.AddSlide()

' Remove slide
document.Slides(0).Remove()

document.Save("removeSlide.pptx")
VB   C#

重新排序幻灯片

重新排列幻灯片的顺序以更好地适应您的演示流程。 重新排序幻灯片简单高效,这使得更新思路顺序或适应新需求变得容易。

:path=/static-assets/ppt/content-code-examples/how-to/manage-slide-reorder-slide.cs
using IronPPT;

var document = new PresentationDocument();

document.AddSlide();

// Move slide by changing the Index property.
document.Slides[0].Index = 1;

document.Save("reorderSlide.pptx");
Imports IronPPT

Private document = New PresentationDocument()

document.AddSlide()

' Move slide by changing the Index property.
document.Slides(0).Index = 1

document.Save("reorderSlide.pptx")
VB   C#

隐藏幻灯片

在保留幻灯片的情况下隐藏特定幻灯片。 隐藏幻灯片在幻灯片放映期间不会显示,但仍可用于编辑或在未来的演示中使用。

:path=/static-assets/ppt/content-code-examples/how-to/manage-slide-hide-slide.cs
using IronPPT;

var document = new PresentationDocument();

document.AddSlide();

// Hide slide
document.Slides[0].Show = false;

document.Save("hideSlide.pptx");
Imports IronPPT

Private document = New PresentationDocument()

document.AddSlide()

' Hide slide
document.Slides(0).Show = False

document.Save("hideSlide.pptx")
VB   C#