CommentsPart
Overview
CommentsPart is a class in Aspose.Slides for Python.
Manages a slide comments XML part (ppt/comments/slideN.xml).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
part_name | str | Read | Property provides the part’s name within the OPC package |
Methods
| Signature | Description |
|---|---|
__init__(package: OpcPackage, part_name: str) | |
get_comments() → List[CommentData] | Returns a list of all CommentData objects in the part |
get_comments_by_author(author_id: int) → List[CommentData] | Returns CommentData list filtered by the given author_id |
find_comment_by_idx(author_id: int, idx: int) → Optional[CommentData] | Returns the CommentData matching author_id and idx, or None |
find_comment_by_idx_all(idx: int) → Optional[CommentData] | Find a comment by idx across all authors (for parentCmId lookup). |
add_comment(author_id: int, idx: int, text: str, pos_x: float, pos_y: float, dt_str: str, parent_idx: Optional[int]) → CommentData | Append a new comment element and return its CommentData. |
insert_comment(index: int, author_id: int, idx: int, text: str, pos_x: float, pos_y: float, dt_str: str, parent_idx: Optional[int]) → CommentData | Insert a comment at the given index. |
remove_comment(author_id: int, idx: int) | Deletes the comment identified by author_id and idx |
remove_comment_elem(elem: ET._Element) | Removes the XML element representing a comment |
remove_comments_at(index: int) | Removes all comments starting at the specified index |
clear() | Removes all comment entries from the part |
count() → int | Returns the total number of comments in the part |
is_empty() → bool | Returns True if the part contains no comments |
save() | Persists the comments part to its OPC package |
create_for_slide(package: OpcPackage, slide_part_name: str, slide_rels_manager) → 'CommentsPart' | Create a new empty comments part for a slide and register all relationships. |
load_for_slide(package: OpcPackage, slide_part_name: str) → Optional['CommentsPart'] | Load the comments part for a slide, if it exists. |
delete(package: OpcPackage, slide_part_name: str) | Delete the comments part for a slide. |