@@ -12,25 +12,37 @@ class CT_Document(BaseOxmlElement):
1212 """
1313 ``<w:document>`` element, the root element of a document.xml file.
1414 """
15- body = ZeroOrOne ('w:body' )
15+
16+ body = ZeroOrOne ("w:body" )
1617
1718 @property
1819 def sectPr_lst (self ):
1920 """
2021 Return a list containing a reference to each ``<w:sectPr>`` element
2122 in the document, in the order encountered.
2223 """
23- return self .xpath (' .//w:sectPr' )
24+ return self .xpath (" .//w:sectPr" )
2425
2526
2627class CT_Body (BaseOxmlElement ):
27- """
28- ``<w:body>``, the container element for the main document story in
29- ``document.xml``.
30- """
31- p = ZeroOrMore ('w:p' , successors = ('w:sectPr' ,))
32- tbl = ZeroOrMore ('w:tbl' , successors = ('w:sectPr' ,))
33- sectPr = ZeroOrOne ('w:sectPr' , successors = ())
28+ """`w:body`, the container element for the main document story in `document.xml`"""
29+
30+ p = ZeroOrMore ("w:p" , successors = ("w:sectPr" ,))
31+ tbl = ZeroOrMore ("w:tbl" , successors = ("w:sectPr" ,))
32+ bookmarkStart = ZeroOrMore ("w:bookmarkStart" , successors = ("w:sectPr" ,))
33+ sectPr = ZeroOrOne ("w:sectPr" , successors = ())
34+
35+ def add_bookmarkStart (self , name , bookmark_id ):
36+ """Return `w:bookmarkStart` element added at end of document.
37+
38+ The newly added `w:bookmarkStart` element is identified by both `name` and
39+ `bookmark_id`. It is the caller's responsibility to determine that both `name`
40+ and `bookmark_id` are unique, document-wide.
41+ """
42+ bookmarkStart = self ._add_bookmarkStart ()
43+ bookmarkStart .name = name
44+ bookmarkStart .id = bookmark_id
45+ return bookmarkStart
3446
3547 def add_section_break (self ):
3648 """Return `w:sectPr` element for new section added at end of document.
0 commit comments