powerpoint package
类
PowerPoint.Application | |
PowerPoint.Presentation | |
PowerPoint.RequestContext |
RequestContext 对象有助于向 PowerPoint 应用程序发出请求。 由于 Office 加载项和 PowerPoint 应用程序在两个不同的进程中运行,因此需要请求上下文才能从外接程序访问 PowerPoint 对象模型。 |
接口
PowerPoint.Interfaces.BulletFormatData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.BulletFormatUpdateData |
用于更新 BulletFormat 对象上的数据的接口,用于 在 中使用 |
PowerPoint.Interfaces.CollectionLoadOptions |
提供仅加载集合的一部分成员的属性的方法。 |
PowerPoint.Interfaces.ParagraphFormatData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.ParagraphFormatUpdateData |
用于更新 ParagraphFormat 对象上的数据的接口,可在 中使用 |
PowerPoint.Interfaces.PresentationData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.PresentationLoadOptions | |
PowerPoint.Interfaces.ShapeCollectionData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.ShapeCollectionUpdateData |
用于更新 ShapeCollection 对象上的数据的接口,用于 在 中使用 |
PowerPoint.Interfaces.ShapeData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.ShapeFillData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.ShapeFillUpdateData |
用于更新 ShapeFill 对象上的数据的接口,用于 在 中使用 |
PowerPoint.Interfaces.ShapeFontData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.ShapeFontUpdateData |
用于更新 ShapeFont 对象上的数据的接口,可在 中使用 |
PowerPoint.Interfaces.ShapeLineFormatData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.ShapeLineFormatUpdateData |
用于更新 ShapeLineFormat 对象上的数据的接口,用于 在 中使用 |
PowerPoint.Interfaces.ShapeScopedCollectionData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.ShapeScopedCollectionUpdateData |
用于更新 ShapeScopedCollection 对象上的数据的接口,在 中使用 |
PowerPoint.Interfaces.ShapeUpdateData |
用于更新 Shape 对象上的数据的接口,用于 在 中使用 |
PowerPoint.Interfaces.SlideCollectionData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.SlideCollectionUpdateData |
用于更新 SlideCollection 对象上的数据的接口,可在 中使用 |
PowerPoint.Interfaces.SlideData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.SlideLayoutCollectionData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.SlideLayoutCollectionUpdateData |
用于更新 SlideLayoutCollection 对象上的数据的接口,在 中使用 |
PowerPoint.Interfaces.SlideLayoutData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.SlideMasterCollectionData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.SlideMasterCollectionUpdateData |
用于更新 SlideMasterCollection 对象上的数据的接口,在 中使用 |
PowerPoint.Interfaces.SlideMasterData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.SlideScopedCollectionData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.SlideScopedCollectionUpdateData |
用于更新 SlideScopedCollection 对象上的数据的接口,可在 中使用 |
PowerPoint.Interfaces.TagCollectionData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.TagCollectionUpdateData |
用于更新 TagCollection 对象上的数据的接口,在 中使用 |
PowerPoint.Interfaces.TagData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.TagUpdateData |
用于更新 Tag 对象上的数据的接口,用于 在 中使用 |
PowerPoint.Interfaces.TextFrameData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.TextFrameUpdateData |
用于更新 TextFrame 对象上的数据的接口,用于 在 中使用 |
PowerPoint.Interfaces.TextRangeData |
一个接口,用于描述通过调用 |
PowerPoint.Interfaces.TextRangeUpdateData |
用于更新 TextRange 对象上的数据的接口,在 中使用 |
枚举
PowerPoint.ErrorCodes |
函数
Power |
创建并打开新演示文稿。 (可选)可以使用 base64 编码的.pptx文件预填充演示文稿。 |
Power |
使用新的 RequestContext 执行对 PowerPoint 对象模型执行操作的批处理脚本。 承诺解决后,将释放在执行过程中自动分配的任何跟踪对象。 |
Power |
使用以前创建的 API 对象的 RequestContext 执行对 PowerPoint 对象模型执行操作的批处理脚本。 承诺解决后,将释放在执行过程中自动分配的任何跟踪对象。 |
Power |
使用以前创建的 API 对象的 RequestContext 执行对 PowerPoint 对象模型执行操作的批处理脚本。 |
函数详细信息
PowerPoint.createPresentation(base64File)
创建并打开新演示文稿。 (可选)可以使用 base64 编码的.pptx文件预填充演示文稿。
export function createPresentation(base64File?: string): Promise<void>;
参数
- base64File
-
string
可选。 base64 编码.pptx文件。 默认值为 null。
返回
Promise<void>
示例
const myFile = <HTMLInputElement>document.getElementById("file");
const reader = new FileReader();
reader.onload = (event) => {
// Remove the metadata before the base64-encoded string.
const startIndex = reader.result.toString().indexOf("base64,");
const copyBase64 = reader.result.toString().substr(startIndex + 7);
PowerPoint.createPresentation(copyBase64);
};
// Read in the file as a data URL so we can parse the base64-encoded string.
reader.readAsDataURL(myFile.files[0]);
PowerPoint.run(batch)
使用新的 RequestContext 执行对 PowerPoint 对象模型执行操作的批处理脚本。 承诺解决后,将释放在执行过程中自动分配的任何跟踪对象。
export function run<T>(batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;
参数
- batch
-
(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>
一个函数,它接受 RequestContext 并返回承诺 (通常只是“context.sync () ”) 的结果。 上下文参数有助于向 PowerPoint 应用程序发出请求。 由于 Office 加载项和 PowerPoint 应用程序在两个不同的进程中运行,因此需要 RequestContext 才能从外接程序访问 PowerPoint 对象模型。
返回
PowerPoint.run(object, batch)
使用以前创建的 API 对象的 RequestContext 执行对 PowerPoint 对象模型执行操作的批处理脚本。 承诺解决后,将释放在执行过程中自动分配的任何跟踪对象。
export function run<T>(object: OfficeExtension.ClientObject, batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;
参数
- object
- OfficeExtension.ClientObject
以前创建的 API 对象。 批处理将使用与传入对象相同的 RequestContext,这意味着“context.sync () ”将选取应用于该对象的任何更改。
- batch
-
(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>
一个函数,它接受 RequestContext 并返回承诺 (通常只是“context.sync () ”) 的结果。 上下文参数有助于向 PowerPoint 应用程序发出请求。 由于 Office 加载项和 PowerPoint 应用程序在两个不同的进程中运行,因此需要 RequestContext 才能从外接程序访问 PowerPoint 对象模型。
返回
PowerPoint.run(objects, batch)
使用以前创建的 API 对象的 RequestContext 执行对 PowerPoint 对象模型执行操作的批处理脚本。
export function run<T>(objects: OfficeExtension.ClientObject[], batch: (context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>): OfficeExtension.IPromise<T>;
参数
- objects
以前创建的 API 对象的数组。 将对数组进行验证,以确保所有对象共享相同的上下文。 批处理将使用此共享的 RequestContext,这意味着“context.sync () ”将选取应用于这些对象的任何更改。
- batch
-
(context: PowerPoint.RequestContext) => OfficeExtension.IPromise<T>
一个函数,它接受 RequestContext 并返回承诺 (通常只是“context.sync () ”) 的结果。 上下文参数有助于向 PowerPoint 应用程序发出请求。 由于 Office 加载项和 PowerPoint 应用程序在两个不同的进程中运行,因此需要 RequestContext 才能从外接程序访问 PowerPoint 对象模型。
返回
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈