title: How to open document that contains AutoOpen macro with PowerShell?
body: <p>My current PowerShell script:</p>
  
  <pre><code>$document = "C:\\test.doc"
  $word = new-object -comobject word.application
  $word.Visible = $false
  $word.DisplayAlerts = "wdAlertsNone"
  $word.AutomationSecurity = "msoAutomationSecurityForceDisable"
  $doc = $word.Documents.Open($document)
  $word.ActivePrinter = "\\http://ptr-server:631\pdf-printer"
  $background = $false
  $doc.PrintOut([ref]$background)
  $doc.close([ref]$false)
  $word.quit()
  </code></pre>
  
  <p>But it results in an alert box <em>The macros in this project are disabled. Please refer to the online help or documentation of the host application to determine how to enable macros.</em></p>
  
  <p>How can I open the document without it running the <code>AutoOpen</code> macro or displaying any sort of dialog prompt?</p>
  
  <p><strong>Environment Details:</strong></p>
  
  <ul>
  <li>Word 2003 SP3</li>
  <li>Windows Server 2003 R2 - Standard Edition - Service Pack 2</li>
  <li>Powershell Version 1.0</li>
  </ul>