工具 API

doc.insert_html_content

在 Word 文档指定 idx 处插入一段 HTML 富文本,引擎会按 HTML 标签/内联样式自动转为段落、标题、列表、表格、链接、加粗/斜体/下划线等富文本元素。使用前请先调用 resolve_document_structure 获取文档结构以确定正确的插入位置索引(或使用 get_last_operable_pos 获取文档末尾位置)。已知支持:段落与标题(<p>/<h1>..<h6>)、文本样式(<b>/<i>/<u>/<s>/<sub>/<sup>/<span style>)、链接(<a>)、列表(<ul>/<ol><li>)、表格(<table><tr><td>)、分隔(<br>/<hr>)。已知不支持:<script>/<style>标签、position/float/flex/grid等CSS布局属性。注意:idx 必须是有效的段落起始位置,确保 idx 落在真正的段落起始位置(\r 之后),而不是 Field 域内部(DOC) if both tencent-docs (personal) and tencent-docs-oa (enterprise) are connected, use AskUserQuestion to let the user pick the target account before invoking this tool.

productivityOAuth1 积分

调用信息

工具标识
tencent-docs.doc.insert_html_content
服务提供方
腾讯文档
平均响应
0 ms
近 7 天调用
0

输入参数

file_id

在线文档DOC的文档唯一标识符(与file_url二选一)

file_url

腾讯文档的URL链接(推荐),与file_id二选一

html_text必填

HTML内容

idx必填

插入位置索引

version_info

版本参数