Forgot to mention one other advantage of using ExtendedProperty is the text it returns.
For example, getting the Horizontal Resolution, ExtendedProperty returns a string of "72" (for example),
whereas GetDetailsOf returns "?72 dpi", so string manipulation is needed to extract the 72 value.
JoJoWhite, I assume your post was in reference to getting the Offset values needed if you use the GetDetailsOf method. I actually do it a slightly different way using :
Code:
' Routine to look for a particular File Attribute
Private Function gGetOffset(pstrAttribute As String)
Dim intItem As Integer
Dim strHeaderInfo As String
Dim intMaxAttrNo As Integer
' Loop through all Metadata looking for a match, exit when found.
intMaxAttrNo = 400 ' Arbitrarily high value.
For intItem = 0 To intMaxAttrNo
strHeaderInfo = gobjFolder.GetDetailsOf(gobjFolder.Items, intItem)
If strHeaderInfo = pstrAttribute Then
Exit For
End If
Next
gGetOffset = intItem
End Function
I see though that your method was to find the specific lens model for an image. Surely that would be inefficient if you need to get the details for hundreds of files as I do. You don't want to have to be looping through all the MetaData for each image. Just get the offset first and then you can look up the value using GetDetailsOf. Or as I now prefer, just use ExtendedProperty with the specific text string.