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__() -> intThe number of comments in this collection.
Returns
intadd_comment
funcadd_comment(text: str = '', author: str = '', initials: str | None = '') -> CommentAdd 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.Commentget
funcget(comment_id: int) -> Comment | NoneReturn the comment identified by comment_id, or None if not found.
paramcomment_idintReturns
docx.comments.Comment | None