Use the Office JavaScript API to extend functionality for Word, Excel, PowerPoint, and Outlook. Learn more about Office Add-ins Word Extend Word across multiple platforms Excel Build applications with Excel Pow
使用特定于应用程序的 Office JavaScript API生成外接程序时,请务必包含错误处理逻辑,以考虑运行时错误。 由于 API 的异步性质,这样做至关重要。 最佳做法 在我们的代码示例和Script Lab代码片段中,你会注意到,对、PowerPoint.run或Word.run的每个调用Excel.run都附带一个catch语句来捕获任何错误。 建议在使用特定...
ExcelApiOnline 1.1:Excel JavaScript API 仅联机要求集 WordApiOnline 1.1:Word JavaScript API 仅联机要求集 WordApiDesktop 1.2:Word JavaScript API 仅限桌面的要求集 1.2 WordApiDesktop 1.1:Word JavaScript API 仅限桌面的要求集 1.1 WordApiHiddenDocument 1.5:Word JavaScript API 仅限桌面 (隐藏文档) 要求集...
使用Office JavaScript API 可以根据 Office 应用程序的区域设置确定区域设置和显示字符串,或者根据数据的区域设置解释或显示数据。
矩阵绑定- 绑定到文档的固定区域,其中包含不带标题的表格数据。矩阵绑定中的数据以二维数组的形式写入或读取,在 JavaScript 中,二维数组作为数组实现。 例如,两行两列string值可以写入或读取为[['a', 'b'], ['c', 'd']],而三行单列则可以写入或读取为[['a'], ['b'], ['c']]。
JavaScript awaitExcel.run(async(context) => {letsheet = context.workbook.worksheets.getItem("Sample");letexpensesTable = sheet.tables.add("A1:D1",true/*hasHeaders*/); expensesTable.name ="ExpensesTable"; expensesTable.getHeaderRowRange().values = [["Date","Merchant","Category","Amount"]]...
为了创建跨不同 Office 文档无缝工作的扩展,Office JavaScript API 通过常见数据类型和将不同文档内容强制转换为三种常见数据类型的功能,抽象化了每个 Office 应用程序的特殊性。通用数据类型在基于选区和基于绑定的数据访问中,文档内容通过跨所有受支持的 Office 应用程序通用的数据类型来公开。 支持三种main数据类型。
Office 加载项可能依赖于特定 Office 应用程序 (也称为 Office 主机) 或 Office JavaScript 库 (office.js) 的特定成员。 例如,你的外接程序可能:在单个 Office 应用程序 (运行,例如,Word、Excel) 或多个应用程序。 使用仅在某些 Office 版本中可用的 Office JavaScript API。 例如,Excel 2016的批量许可永久...
... This will download and cache the Office JavaScript API files the first time your add-in loads to make sure that it is using the most up-to-date implementation of Office.js and its associated files for the specified version. For more information, including how to reference preview APIs...
To learn more about NAA, including samples for both Outlook and Word, Excel, and PowerPoint add-ins, seeEnable SSO in an Office Add-in using nested app authentication (preview). JavaScript runtime update The JavaScript-only runtime is moving to the V8 JavaScript engine. Excel custom functions...