title: Closing application (Acrobat, Word, Excel) after closing the last document
body: <p>I have a few functions that generate Word, Excel or PDF documents. For example, the one I'm working on is exporting a report to a PDF file. After closing the report, it opens another PDF form created with LiveCycle ES 8.2 and it fills it with data from a database. After this, the document is closed, but for some reason, the instance of Acrobat is still open in foreground with no document opened.</p>
  
  <p>Here is the code:</p>
  
  <pre class="lang-vb prettyprint-override"><code>DoCmd.OpenReport "myReport", acViewPreview
  DoCmd.OutputTo acOutputReport, "", acFormatPDF, "C:\myReport.pdf", False
  DoCmd.Close acReport, "myReport"
  
  Dim gApp, avDoc, pdDoc, jso
  
  Set gApp = CreateObject("AcroExch.app")
  Set avDoc = CreateObject("AcroExch.AVDoc")
  If avDoc.Open(exprPDF, "") Then
      Set pdDoc = avDoc.GetPDDoc()
      Set jso = pdDoc.GetJSObject
  
      '[...]
  
      pdDoc.Save PDSaveIncremental, FileNm 'Save changes to the PDF document
      pdDoc.Close 'Close the PDF document
  End If
  
  avDoc.Close (True)
  Set gApp = Nothing
  Set avDoc = Nothing
  </code></pre>
  
  <p>myReport never opens any instance of Acrobat. The line <code>avDoc.Open</code> does. I would like Acrobat to be closed when I do <code>avDoc.close</code>. Any ideas?</p>