title: How to determine if document is a template?
body: <p>I am trying to figure out if a document is a simple document (.doc, .docx, .docm) or a template (.dot, .dotx, .dotm).</p>
  
  <p>I know there are several ways to figure this out (like check file extension), but I am looking for the most "safe" one.</p>
  
  <p>My current guess is:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Private Function isTemplate(ByVal Doc As Document) As Boolean
      isTemplate = (Doc.FullName = Doc.AttachedTemplate.FullName)
  End Function
  </code></pre>
  
  <p>This works as expected, but I would like to know if there is a more fashioned way to achieve this goal. Maybe some missing isTemplate property? dunno.</p>
  
  <p>Why: I've created a code on a template to don't allow a user to save a file if it is not password protected. The code works like a charm, but it bores me when I am editing something in the template because it doesn't have a password.</p>