title: Unwanted SaveAs popup window displays when doc.Close() perform for pywin32com
body: <p>I am trying to create Table of Contents for the Word document generated using python-docx module.</p>
  <pre><code>    paragraph = doc.add_paragraph()
      run = paragraph.add_run()
      fld_char = OxmlElement('w:fldChar') 
      fld_char.set(ns.qn('w:fldCharType'), 'begin')
      instr_text = OxmlElement('w:instrText')
      instr_text.set(ns.qn('xml:space'), 'preserve')
      instr_text.text = 'TOC \\o &quot;1-5&quot; \\h \\z \\u'
  
      fld_char2 = OxmlElement('w:fldChar')
      fld_char2.set(ns.qn('w:fldCharType'), 'separate')
      fld_char3 = OxmlElement('w:t')
      fld_char3.text = &quot;Right-click to update field.&quot;
      fld_char3 = OxmlElement('w:updateFields') 
      fld_char3.set(ns.qn('w:val'), 'true')
      fld_char2.append(fld_char3)
  
      fld_char4 = OxmlElement('w:fldChar')
      fld_char4.set(ns.qn('w:fldCharType'), 'end')
  
      r_element = run._r
      r_element.append(fld_char)
      r_element.append(instr_text)
      r_element.append(fld_char2)
      r_element.append(fld_char4)
  </code></pre>
  <p>But i have seen a pop up with yes or no during opening the document.
  To avoid the yes or no pop up.
  I tried to open the file through pywin32 and tried to update the Table of Contents and trying to save.
  While saving facing an issue as saveAs pop windows appears.</p>
  <pre><code>word = win32com.client.DispatchEx(&quot;Word.Application&quot;)
  word.Visible = False
  doc1 = word.Documents.Open(file_name)
  doc1.TablesOfContents(1).Update()
  doc1.Close(SaveChanges=True)
  word.Application.Quit()
  </code></pre>
  <p>But i am pretty sure if i could bypass this saveAs issue the application saves successfully without any errors or pop up messages while opening.</p>
  <pre><code>doc1.Close(False)
  </code></pre>
  <p>If i try with SaveChanges = False then yes or no pop is appearing while opening the document.
  Please share your thoughts or suggestions to fix the issue while SaveChanges = True. I am assuming document is becoming readonly mode some how. so it is displaying saveAs window.</p>
  <p>Document is of 500 pages contains images, tables and text.</p>
  <p><strong>Update:</strong>
  After debugging further identified the issue same as <a href="https://stackoverflow.com/questions/68851068/picture-in-header-hide-first-picture-in-docx-with-python-docx">here</a> and <a href="https://stackoverflow.com/questions/68486580/python-docx-missing-first-image">here</a></p>
  <p>Any suggestions for the fix? in the second link Scanny mentioned 1 pixel fix which couldn't understand.</p>