Word.RequestContext class

RequestContext 对象有助于请求 Word 应用程序。 由于 Office 加载项和 Word 应用程序在两个不同的进程中运行,因此需要请求上下文才能从加载项访问 Word 对象模型。

扩展

注解

使用方

示例

// *.run methods automatically create an OfficeExtension.ClientRequestContext
// object to work with the Office file.
await Word.run(async (context: Word.RequestContext) => {
  const document = context.document;
  // Interact with the Word document...
});

构造函数

(constructor)(url)

构造类的新 RequestContext 实例

构造函数详细信息

(constructor)(url)

构造类的新 RequestContext 实例

constructor(url?: string);

参数

url

string

属性详细信息

application

API 集:WordApi 1.3 *

readonly application: Application;

属性值

document

readonly document: Document;

属性值

sensitivityLabelsCatalog

readonly sensitivityLabelsCatalog: SensitivityLabelsCatalog;

属性值