Paper Office
paper-docxAPI referencecomments

Comments

paper-docx 0.2.0 API reference

Collection containing the comments added to this document.

Comments(comments_elm: CT_Comments, comments_part: CommentsPart)

Functions

__iter__

func__iter__() -> Iterator[Comment]

Iterator over the comments in this collection.

Returns

typing.Iterator[docx.comments.Comment]

__len__

func__len__() -> int

The number of comments in this collection.

Returns

int

add_comment

funcadd_comment(text: str = '', author: str = '', initials: str | None = '') -> Comment

Add a new comment to the document and return it.

Assigns a unique id and writes the modern identity parts (commentsIds, commentsExtensible, a w14:paraId) that Word needs to thread replies. Refuses a protected document, a collection whose part was removed or replaced, and an ambiguous comments relationship.

paramtextstr
= ''
paramauthorstr
= ''
paraminitialsstr | None
= ''

Returns

docx.comments.Comment

get

funcget(comment_id: int) -> Comment | None

Return the comment identified by comment_id, or None if not found.

paramcomment_idint

Returns

docx.comments.Comment | None

On this page