title: Check if BuiltInDocumentProperty is set without error trapping
body: <p><b>Task:</b> 
  My goal is to check if a value has been set in the BuiltInDocumentProperties collection of an Excel workbook.</p>
  
  <p><b>Amplifying remark:</b>
  I know that some doc properties items never show a value in Excel as they 
  belong to ms word or ppt applications (e.g. item 15 'Number of words', item 25 'Slides' ...).
  On the other hand some properties have only occasional values in case of first use:</p>
  
  <ul>
  <li>item 10:    'Last print time'</li>
  <li>item 12: 'Last save time'    </li>
  </ul>
  
  <p>Of course one can do that by error trapping:</p>
  
  <p><b>Example Code with Error trapping:</b></p>
  
  <pre><code>Sub test_showDocPropValue()
  ' Name of built in doc prog
    Dim propName As String
  ' a) Choose builtin doc prop disposing about a set value, such as 'Author', 'Category', ...
  '    propName = "Category"
  ' b) Choose builtin doc prop of another ms application
  '    propName = "Number of pages"
  
  ' c) Choose doc prop with occasionally set values
    propName = "Last print time"
  
  ' Show result
    MsgBox propName &amp; " = " &amp; showDocPropValue(propName), vbInformation, "BuiltInDocumentProperties"
  End Sub
  
  Function showDocPropValue(ByVal propName As String) As Variant
    Dim prop As Object
    Dim ret
  ' Built in Doc Props collection
    Set prop = ThisWorkbook.BuiltinDocumentProperties
  ' Error trapping
    On Error Resume Next
    ret = prop(propName).Value
    If Err.Number &lt;&gt; 0 Then
       ret = "(No value set)"
       Debug.Print Err.Number &amp; ": " &amp; Err.Description
    End If
  ' Return
    showDocPropValue = ret
  End Function
  </code></pre>
  
  <p><b>My Question:</b>
  For principal reasons I'd like to know if there is a straightforward method to get builtinDocumentProperties values avoiding error trapping</p>
  
  <p><b>Additional hint</b>
  Just to complete the theme by showing methods without error trapping within CUSTOM doc props, you can easily check for the existence of such items with the following code:</p>
  
  <pre><code>Private Function bCDPExists(sCDPName As String) As Boolean
  ' Purp.: return True|False if custom document property name exists
  ' Meth.: loop thru CustomDocumentProperties and check for existing sCDPName parameter 
  ' Site:  &lt;http://stackoverflow.com/questions/23917977/alternatives-to-public-variables-in-vba/23918236#23918236&gt;
  ' cf:    &lt;https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/using-customdocumentproperties-with-vba/91ef15eb-b089-4c9b-a8a7-1685d073fb9f&gt;
  Dim cdp As Variant      ' element of CustomDocumentProperties Collection
  Dim boo As Boolean      ' boolean value showing element exists
  For Each cdp In ThisWorkbook.CustomDocumentProperties
      If LCase(cdp.Name) = LCase(sCDPName) Then
         boo = True      ' heureka
         Exit For        ' exit loop
      End If
  Next
  bCDPExists= boo          ' return value to function
  End Function
  </code></pre>