add_comment
Add a comment or a threaded reply to a document.
- To add a root comment, provide
target_paragraph_id. Optionally, provideanchor_textto anchor the comment to a specific span of text within the paragraph. Ifanchor_textis omitted, the comment anchors to the entire paragraph. - To add a threaded reply, provide
parent_comment_idwith the ID of the comment you want to reply to.
Path to the DOCX file.
_bk_* paragraph ID to anchor the comment to. Required for root comments.Text within the paragraph to anchor the comment highlight to. If omitted, the comment anchors to the entire paragraph.
ID of the parent comment. Provide this to add a threaded reply instead of a root comment.
Comment author name.
Comment body text.
Author initials displayed in the comment balloon. Defaults to the first letter of
author.get_comments
Retrieve all comments from the document, including IDs, authors, creation dates, body text, and the paragraph IDs each comment is anchored to. Threaded replies are included and nested under their parent.
Hints: readOnly — does not modify the document.
Path to the DOCX file.
delete_comment
Delete a comment and all of its threaded replies. Deletion cascades to all descendants of the target comment.
Path to the DOCX file.
ID of the comment to delete. Retrieve comment IDs with
get_comments.get_footnotes
Retrieve all footnotes from the document, including IDs, display numbers, body text, and the paragraph IDs each footnote reference is anchored to.
Hints: readOnly — does not modify the document.
Path to the DOCX file.
add_footnote
Add a footnote anchored to a paragraph. By default, the footnote reference is appended at the end of the paragraph. Use after_text to position the reference after a specific span of text.
The
[^N] markers you see in read_file output are display-only indicators. They are not part of the paragraph’s editable text and should not be included in old_string when calling replace_text.Path to the DOCX file.
_bk_* paragraph ID to anchor the footnote to.Text after which to insert the footnote reference mark. If omitted, the reference is appended at the end of the paragraph.
Footnote body text.
update_footnote
Update the text content of an existing footnote.
Path to the DOCX file.
ID of the footnote to update. Retrieve footnote IDs with
get_footnotes.New footnote body text.
delete_footnote
Delete a footnote and its reference mark from the document.
Path to the DOCX file.
ID of the footnote to delete. Retrieve footnote IDs with
get_footnotes.
