title: This command is not available because no document is open while getting Active document
body: <pre><code>try
  {
       Microsoft.Office.Interop.Word.Application WordObj = System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application") as Microsoft.Office.Interop.Word.Application;
       Office.CustomXMLParts currClassification = WordObj.ActiveDocument.CustomXMLParts;
  }
  catch(Exception ex)
  {
       //I am getting, This command is not available because no document is open. this error here.
  }
  </code></pre>
  
  <p>When I am using above code, I am getting this error:</p>
  
  <blockquote>
    <p>This command is not available because no document is open.</p>
  </blockquote>
  
  <p>Regards</p>