MCPcopy Index your code
hub / github.com/python-openxml/python-docx / mark_comment_range

Method mark_comment_range

src/docx/text/run.py:176–186  ·  view source on GitHub ↗

Mark the range of runs from this run to `last_run` (inclusive) as belonging to a comment. `comment_id` identfies the comment that references this range.

(self, last_run: Run, comment_id: int)

Source from the content-addressed store, hash-verified

174 yield Drawing(item, self)
175
176 def mark_comment_range(self, last_run: Run, comment_id: int) -> None:
177 """Mark the range of runs from this run to `last_run` (inclusive) as belonging to a comment.
178
179 `comment_id` identfies the comment that references this range.
180 """
181 # -- insert `w:commentRangeStart` with `comment_id` before this (first) run --
182 self._r.insert_comment_range_start_above(comment_id)
183
184 # -- insert `w:commentRangeEnd` and `w:commentReference` run with `comment_id` after
185 # -- `last_run`
186 last_run._r.insert_comment_range_end_and_reference_below(comment_id)
187
188 @property
189 def style(self) -> CharacterStyle:

Callers 2

add_commentMethod · 0.80

Tested by 1