PowerPointApi 1.5 添加了用于选择演示文稿中的幻灯片、文本范围和形状的 API。 在此版本之前,选择幻灯片和形状需要一系列复杂的步骤。 这些选择 API 使开发人员能够直接选择幻灯片、文本区域和形状,从而创建更高效、更直观的外接程序开发过程。
API 列表
下表列出了 PowerPoint JavaScript API 要求集 1.5。 有关所有 PowerPoint JavaScript API 的完整列表, (包括预览 API 和以前发布的 API) ,请参阅 所有 PowerPoint JavaScript API。
类 | 域 | 说明 |
---|---|---|
Presentation | getSelectedShapes () | 返回演示文稿当前幻灯片中的选定形状。 |
getSelectedSlides () | 返回演示文稿当前视图中的选定幻灯片。 | |
getSelectedTextRange () | 返回演示文稿当前视图中选定的 PowerPoint.TextRange。 | |
getSelectedTextRangeOrNullObject () | 返回演示文稿当前视图中选定的 PowerPoint.TextRange。 | |
id | 获取演示文稿的 ID。 | |
setSelectedSlides (slideIds: string[]) | 选择演示文稿当前视图中的幻灯片。 | |
Shape | getParentSlide () | 返回包含此 Shape 的父 PowerPoint.Slide 对象。 |
getParentSlideLayout () | 返回包含此 Shape 的父 PowerPoint.SlideLayout 对象。 |
|
getParentSlideLayoutOrNullObject () | 返回包含此 Shape 的父 PowerPoint.SlideLayout 对象。 |
|
getParentSlideMaster () | 返回包含此 Shape 的父 PowerPoint.SlideMaster 对象。 |
|
getParentSlideMasterOrNullObject () | 返回包含此 Shape 的父 PowerPoint.SlideMaster 对象。 |
|
getParentSlideOrNullObject () | 返回包含此 Shape 的父 PowerPoint.Slide 对象。 |
|
ShapeScopedCollection | getCount() | 获取集合中的形状数。 |
getItem(key: string) | 使用形状的唯一 ID 获取形状。 | |
getItemAt(index: number) | 使用集合中从零开始的索引获取形状。 | |
getItemOrNullObject(id: string) | 使用形状的唯一 ID 获取形状。 | |
items | 获取此集合中已加载的子项。 | |
Slide | setSelectedShapes (shapeIds: string[]) | 选择指定的形状。 |
SlideScopedCollection | getCount() | 获取集合中的幻灯片数。 |
getItem(key: string) | 使用幻灯片的唯一 ID 获取幻灯片。 | |
getItemAt(index: number) | 使用集合中从零开始的索引获取幻灯片。 | |
getItemOrNullObject(id: string) | 使用幻灯片的唯一 ID 获取幻灯片。 | |
items | 获取此集合中已加载的子项。 | |
TextFrame | getParentShape () | 返回包含此 TextFrame 的父 PowerPoint.Shape 对象。 |
TextRange | getParentTextFrame () | 返回包含此 TextRange 的父 PowerPoint.TextFrame 对象。 |
Length | 获取或设置此 TextRange 表示的范围的长度。 |
|
setSelected () | 在当前视图中选择此项 TextRange 。 |
|
start | 获取或设置相对于父文本框架的从零开始的索引,用于表示的区域 TextRange 的起始位置。 |