title: How to suppress the "Microsoft PDF Reflow has stopped working" error when using python to open pdf file with MS Word?
body: <p>I was trying to automate the pdf-to-docx process using python.
  PDF Reflow will automatically opened if I open pdf files with MS Word. Therefore, I used it as an OCR tool.
  I have suppressed the message boxes from Word by using word_app.DisplayAlerts=0 and try-except.
  However, message box "Microsoft PDF Reflow has stopped working" still popped out sometimes. </p>
  
  <p>Now I should manually close those message boxes and it is not reasonable for an automated process. Is there anyway to suppress the errors from PDF Reflow?</p>
  
  <p>Below is the code I use:</p>
  
  <pre><code>import pythoncom
  import win32com
  from win32com.client import Dispatch, constants
  #import logging
  
  word_app = win32com.client.gencache.EnsureDispatch("Word.Application")
  
  word_app.Visible = 0
  word_app.DisplayAlerts = 0
  wc = win32com.client.constants
  try:
      word_doc = word_app.Documents.Open('file.pdf')
  except pythoncom.com_error as e:
      print(e)
      #logger.info(e)
  word_doc.SaveAs(FileName  = 'file.docx', FileFormat = wc.wdFormatXMLDocument)
  word_doc.Close(SaveChanges = wc.wdDoNotSaveChanges)
  
  word_app.Quit()
  </code></pre>
  
  <p>Thank you for any help!</p>