How to reset page number to 1 in python-docx?
问题 I've added a Field 'Page' to my code using code: def _add_field(run, field): """ add a field to a run """ fldChar1 = OxmlElement('w:fldChar') # creates a new element fldChar1.set(qn('w:fldCharType'), 'begin') # sets attribute on element instrText = OxmlElement('w:instrText') instrText.set(qn('xml:space'), 'preserve') # sets attribute on element instrText.text = field fldChar2 = OxmlElement('w:fldChar') fldChar2.set(qn('w:fldCharType'), 'separate') t = OxmlElement('w:t') t.text = "Right-click