wps_word_add_toc
Insert an automatic, updatable table of contents (TOC) with page numbers and hyperlinks into a WPS Word document. Place the TOC after a specified paragraph or at the document start, using heading styles 1–3.
Instructions
插入自动目录(TOC 域,可更新、带页码与超链接)。用于替代手写静态目录:先把正文各级标题设置为"标题 1/2/3"样式,再调用本工具。after_text 指定在哪个段落文本之后插入(常用"目 录"标题段);不给则插到文档开头。目录内容由 TOC 域生成,右键可更新域或执行 UpdateFields。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| levels | No | 目录包含的最高标题级别,默认 3 | |
| after_text | No | 在此段落文本之后插入目录;默认文档开头 | |
| upper_level | No | 目录包含的最低标题级别,默认 1 |