title: Document printed via Word Interop immediately disappears from print queue
body: <p>I have a C# WinForm application that opens and fills out a MS Word dotx template by placing text at bookmarks, and then attempts to print it, all using MS Word Interop 15. </p>
  
  <p>Everything seems to go fine, the print dialog shows and completes OK, the print job shows up in the print queue (i.e. the "See what's printing" window from "Devices and Printers" on MS Windows 10). But then the job immediately disappears from the queue before it can be spooled! (document appears very very briefly with "Spooling" status, and does not print - the printer never gets the job)</p>
  
  <p>Here is my code (exception checking removed for brevity):</p>
  
  <pre><code>using Word = Microsoft.Office.Interop.Word;
  private void Print_Click(object sender, EventArgs e)
  {
      // Open the MS Word application via Office Interop
      Word.Application wordApp = new Word.Application();
      Word.Document wordDoc;
      // Open the template
      wordDoc = wordApp.Documents.Add(Template: ContractTemplatePath, Visible: false);
      // Ensure the opened document is the currently active one
      wordDoc.Activate();
  
      // Set the text for each bookmark from the corresponding data in the GUI
      SetBookmarkText(wordDoc, "Foo", fooTextBox.Text);
      // ... There's a whole bunch of these ... then:
  
      // Instantiate and configure the PrintDialog
      var pd = new PrintDialog()
      {
          UseEXDialog = true,
          AllowSomePages = false,
          AllowSelection = false,
          AllowCurrentPage = false,
          AllowPrintToFile = false
      };
  
      // Check the response from the PrintDialog
      if (pd.ShowDialog(this) == DialogResult.OK)
      {
          // Print the document
          wordApp.ActivePrinter = pd.PrinterSettings.PrinterName;
          wordDoc.PrintOut(Copies: pd.PrinterSettings.Copies);
      }
  
      // Close the document without saving the changes (once the 
      // document is printed we don't need it anymore). Then close 
      // the MS Word application.
      wordDoc.Close(SaveChanges: false);
      wordApp.Quit(SaveChanges: false);
  }
  </code></pre>
  
  <p>The only thing I can think of here is that maybe because I do away with the document as soon as I've sent it to the printer, then the job hasn't been completely sent so it removes itself or something. If this <em>is</em> the case then how can I determine how long I need to keep the document around for and what's the best way of waiting for that?</p>
  
  <p><strong>EDIT:</strong> Ive done another small bit of research (dont have time for more on this just at this moment) that suggests I may be able to use the PrintEnd event, but I couldn't immediately see if this would be applicable when using Interop. Would it be a method of achieving what I want without polling?</p>