doc-core-api
Installation
SKILL.md
WPS Writer JS API 核心参考
代码执行环境
- 代码通过
new Function(code)()在 WPS Plugin Host 中同步执行 - 全局可用对象:
Application,wps - 必须使用
var声明变量(不支持 let/const/箭头函数) - 最后一行必须返回结果字符串
常用对象
Application.ActiveDocument // 当前文档 (Document)
Application.Selection // 当前选区 (Selection)
Document.Content // 全文 Range
Document.Paragraphs // 段落集合 Paragraphs
Document.Tables // 表格集合 Tables
Document.Sections // 节集合 Sections
Document.Bookmarks // 书签集合