title: Check if a Word Document is password protected without opening it
body: <p>I'm using the Microsoft Office Interop namespace in order to password protect Word documents. 
  I first create an instance of Word as a background process and gather the list of Word documents I want to protect. The issue I have is that when the application gets to an already secure document it opens with a prompt for the set password. After dismissing this it runs through the rest of the documents with the instance of Word now in the foreground.</p>
  
  <p>I would like to skip past the previously protected documents. My code is currently as follows:</p>
  
  <pre><code>    private void Protect_Word(FileInfo file)
      {
              Word.Document doc = wrd.Documents.Open(file.FullName);
              if (!doc.HasPassword)
              { 
                  doc.Password = this.passwordBox.Text;
                  doc.Save();
  
              }
              ((Microsoft.Office.Interop.Word._Document)doc).Close(0);
      }
  </code></pre>
  
  <p>The problem with this setup is that the password for a document is being asked for before I can call HasPassword. Is there a way I can programatically check the document for a password prior to actually opening it?</p>