Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
9,797
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I was spurred to explore this subject further after this recent thread

As far as I can see, there seems to be no easy way to edit file properties programmatically without needing to resort to external components such as CDDBControl.dll or CDDBControlRoxio.dll (which by the way these two dlls don't seem to work in x64 anyway, plus they are a nightmare to install & register).There may be other 3rd party libraries that could be used but it would be great if we could read and edit file properties hassle-free and with vba alone.

So, to this end, I have been experimenting with relevant interfaces (PropertyStore, IPropertyDescription, IPropertyDescriptionList, IPropertySystem) and I seem to have come up with some pretty good results when testing in x32 and x64... I just hope it works consistently accross diff systems.

File Demo:
FileMetadataProperties.xlsm





This vba project code offers esay to use functions for reading and editing properties of all kind of files (not just media MP3s)
VBA Code:
Public Function GetPropertyValue( _
    ByVal sPathFile As String, _
    ByVal Prop As Property_Name _
) As String

And
VBA Code:
Public Function SetPropertyValue( _
    ByVal sPathFile As String, _
    ByVal Prop As Property_Name, _
    ByVal Property_NewValue As Variant _
) As Boolean

VBA Code:
Public Function PropertyDump() As String()

VBA Code:
Public Function GetAllFileProperties(sPathFile As String) As String()

Useful headers for reference:
propsys.h
propKey.h

The code is quite long so I will be splitting it into two sections and post them in the next two following posts.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Code Section 1

1
- Core api code in a Standard Module:
VBA Code:
Option Explicit

#If Win64 Then
    Private Const NULL_PTR = 0^
    Private Const PTR_LEN = 8&
#Else
    Private Const NULL_PTR = 0&
    Private Const PTR_LEN = 4&
#End If

Private Enum Vtble_Ordinals
    'IUnknown
    QueryInterface = 0&
    Release = 2&
    'IPropertyStore
    GetCount = 3&
    GetAt = 4&
    SetValue = 6&
    Commit = 7&
    'IPropertyDescription
    GetCanonicalName = 4&
    GetDisplayName = 6&
    'IPropertySystem
    EnumeratePropertyDescriptions = 6&
    'IPropertyDescriptionList
    GetCount_ = 3&
    GetAt_ = 4&
End Enum

Private Enum PROPDESC_FORMAT_FLAGS
  PDFF_DEFAULT = 0&
  PDFF_PREFIXNAME = 1&
  PDFF_FILENAME = 2&
  PDFF_ALWAYSKB = 4&
  PDFF_RESERVED_RIGHTTOLEFT = 8&
  PDFF_SHORTTIME = &H10
  PDFF_LONGTIME = &H20
  PDFF_HIDETIME = &H40
  PDFF_SHORTDATE = &H80
  PDFF_LONGDATE = &H100
  PDFF_HIDEDATE = &H200
  PDFF_RELATIVEDATE = &H400
  PDFF_USEEDITINVITATION = &H800
  PDFF_READONLY = &H1000
  PDFF_NOAUTOREADINGORDER = &H2000
 End Enum

Private Enum GETPROPERTYSTOREFLAGS
  GPS_DEFAULT = 0&
  GPS_HANDLERPROPERTIESONLY = 1&
  GPS_READWRITE = 2&
  GPS_TEMPORARY = 4&
  GPS_FASTPROPERTIESONLY = 8&
  GPS_OPENSLOWITEM = &H10
  GPS_DELAYCREATION = &H20
  GPS_BESTEFFORT = &H40
  GPS_NO_OPLOCK = &H80
  GPS_PREFERQUERYPROPERTIES = &H100
  GPS_EXTRINSICPROPERTIES = &H200
  GPS_EXTRINSICPROPERTIESONLY = &H400
  GPS_VOLATILEPROPERTIES = &H800
  GPS_VOLATILEPROPERTIESONLY = &H1000
  GPS_MASK_VALID = &H1FFF
End Enum

Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(0 To 7) As Byte
End Type

Private Type PROPERTYKEY
    fmtid As GUID
    pid As Long
End Type

#If VBA7 Then
    Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As LongPtr)
    Private Declare PtrSafe Function lstrlen Lib "kernel32" Alias "lstrlenW" (ByVal lpString As LongPtr) As Long
    Private Declare PtrSafe Function SysReAllocString Lib "OLEAUT32.DLL" (ByVal pBSTR As LongPtr, Optional ByVal pszStrPtr As LongPtr) As Long
    Private Declare PtrSafe Sub CoTaskMemFree Lib "ole32.dll" (ByVal PV As LongPtr)
    Private Declare PtrSafe Function CoInitialize Lib "ole32.dll" (ByVal pvReserved As LongPtr) As Long
    Private Declare PtrSafe Function CoUninitialize Lib "ole32" () As Long
    Private Declare PtrSafe Function CLSIDFromString Lib "ole32" (ByVal OleStringCLSID As LongPtr, ByRef cGUID As Any) As Long
    Private Declare PtrSafe Function PSGetPropertyKeyFromName Lib "propsys.dll" (ByVal pszName As LongPtr, ppropkey As PROPERTYKEY) As Long
    Private Declare PtrSafe Function PSFormatPropertyValue Lib "propsys.dll" (ByVal pps As LongPtr, ByVal ppd As LongPtr, ByVal pdff As PROPDESC_FORMAT_FLAGS, ppszDisplay As LongPtr) As Long
    Private Declare PtrSafe Function PSGetPropertyDescription Lib "propsys.dll" (PropKey As PROPERTYKEY, riid As GUID, ppv As Any) As Long
    Private Declare PtrSafe Function PSGetNameFromPropertyKey Lib "propsys.dll" (PropKey As PROPERTYKEY, ppszCanonicalName As LongPtr) As Long
    Private Declare PtrSafe Function PSGetPropertySystem Lib "propsys.dll" (riid As GUID, ppv As Any) As Long
    Private Declare PtrSafe Function SHGetPropertyStoreFromParsingName Lib "shell32" (ByVal pszPath As LongPtr, pbc As Any, ByVal Flags As GETPROPERTYSTOREFLAGS, riid As GUID, ppv As Any) As Long
    Private Declare PtrSafe Function DispCallFunc Lib "OLEAUT32.DLL" (ByVal pvInstance As LongPtr, ByVal offsetinVft As LongPtr, ByVal CallConv As Long, ByVal retTYP As Integer, ByVal paCNT As Long, ByRef paTypes As Integer, ByRef paValues As LongPtr, ByRef retVAR As Variant) As Long
    Private Declare PtrSafe Sub SetLastError Lib "kernel32.dll" (ByVal dwErrCode As Long)
#Else
    Private Enum LongPtr
        [_]
    End Enum
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As LongPtr)
    Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenW" (ByVal lpString As LongPtr) As Long
    Private Declare Function SysReAllocString Lib "OLEAUT32.DLL" (ByVal pBSTR As LongPtr, Optional ByVal pszStrPtr As LongPtr) As Long
    Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal PV As LongPtr)
    Private Declare Function CoInitialize Lib "ole32.dll" (ByVal pvReserved As LongPtr) As Long
    Private Declare Function CoUninitialize Lib "ole32" () As Long
    Private Declare Function CLSIDFromString Lib "ole32" (ByVal OleStringCLSID As LongPtr, ByRef cGUID As Any) As Long
    Private Declare Function PSGetPropertyKeyFromName Lib "propsys.dll" (ByVal pszName As LongPtr, ppropkey As PROPERTYKEY) As Long
    Private Declare Function PSFormatPropertyValue Lib "propsys.dll" (ByVal pps As LongPtr, ByVal ppd As LongPtr, ByVal pdff As PROPDESC_FORMAT_FLAGS, ppszDisplay As LongPtr) As Long
    Private Declare Function PSGetPropertyDescription Lib "propsys.dll" (PropKey As PROPERTYKEY, riid As GUID, ppv As Any) As Long
    Private Declare Function PSGetNameFromPropertyKey Lib "propsys.dll" (PropKey As PROPERTYKEY, ppszCanonicalName As LongPtr) As Long
    Private Declare Function PSGetPropertySystem Lib "propsys.dll" (riid As GUID, ppv As Any) As Long
    Private Declare Function SHGetPropertyStoreFromParsingName Lib "shell32" (ByVal pszPath As LongPtr, pbc As Any, ByVal Flags As GETPROPERTYSTOREFLAGS, riid As GUID, ppv As Any) As Long
    Private Declare Function DispCallFunc Lib "OLEAUT32.DLL" (ByVal pvInstance As LongPtr, ByVal offsetinVft As LongPtr, ByVal CallConv As Long, ByVal retTYP As Integer, ByVal paCNT As Long, ByRef paTypes As Integer, ByRef paValues As LongPtr, ByRef retVAR As Variant) As Long
    Private Declare Sub SetLastError Lib "kernel32.dll" (ByVal dwErrCode As Long)
#End If


Public Function GetPropertyValue( _
    ByVal sPathFile As String, _
    ByVal Prop As Property_Name _
) As String

    Const S_OK = 0&, CC_STDCALL = 4&
    Const IID_PropertyStore = "{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99}"
    Const IID_IPropertyDescription = "{6f79d558-3e96-4549-a1d1-7d75d2288814}"
    Dim tPk As PROPERTYKEY, tIID As GUID
    Dim lpPs As LongPtr, lpPd As LongPtr, lpStr As LongPtr
    Dim sDisplayName As String
    
    If Len(Dir(sPathFile)) = 0& Then MsgBox "Invalid filepath.": Exit Function
    
    Call CoInitialize(NULL_PTR)
    
    sDisplayName = DisplayNameToCanonicalName(Prop)
    If Len(sDisplayName) = 0& Then
        Debug.Print "Property not recognized."
        GoTo Xit
    End If
    
    If PSGetPropertyKeyFromName(StrPtr(sDisplayName), tPk) <> S_OK Then
        Debug.Print "Unable to get the property key."
        GoTo Xit
    End If
    
    Call CLSIDFromString(StrPtr(IID_PropertyStore), tIID)
    If SHGetPropertyStoreFromParsingName(StrPtr(sPathFile), ByVal 0&, GPS_DEFAULT Or GPS_BESTEFFORT Or GPS_OPENSLOWITEM, tIID, lpPs) <> S_OK Then
        Debug.Print "Unable to get the property store for the given file."
        GoTo Xit
    End If
    
    Call CLSIDFromString(StrPtr(IID_IPropertyDescription), tIID)
    If PSGetPropertyDescription(tPk, tIID, lpPd) <> S_OK Then
        Debug.Print "Unable to get the property description interface."
        GoTo ReleaseInterface
    End If
    
    If lpPs And lpPd Then
        If PSFormatPropertyValue(lpPs, lpPd, PDFF_DEFAULT, lpStr) <> S_OK Then
            Debug.Print "Unable to get the string representation of the property value stored in the property store."
            GoTo ReleaseInterface
        End If
        GetPropertyValue = CleanSTring(GetStrFromPtrW(lpStr))
    End If
    
ReleaseInterface:
    If lpPd Then
        ' IPropertyDescription::Release
        Call vtblCall(lpPd, Release * PTR_LEN, vbLong, CC_STDCALL)
    End If
    If lpPs Then
        ' IPropertyStore::Release
        Call vtblCall(lpPs, Release * PTR_LEN, vbLong, CC_STDCALL)
    End If
    
Xit:
    Call CoUninitialize

End Function

Public Function SetPropertyValue( _
    ByVal sPathFile As String, _
    ByVal Prop As Property_Name, _
    ByVal Property_NewValue As Variant _
) As Boolean

    Const IID_PropertyStore = "{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99}"
'    Const GPS_READWRITE = 2&, GPS_OPENSLOWITEM = &H10
    Const CC_STDCALL = 4&, S_OK = 0&
    Dim tIID As GUID, lpPs As LongPtr
    
    If Len(Dir(sPathFile)) = 0& Then
        MsgBox "Invalid filename."
        Exit Function
    End If
    
    Call CoInitialize(NULL_PTR)
    
    If CLSIDFromString(StrPtr(IID_PropertyStore), tIID) <> S_OK Then
        Debug.Print "unable to get the IID_PropertyStore interface."
        GoTo Xit
    End If
    
    If SHGetPropertyStoreFromParsingName _
      (StrPtr(sPathFile), ByVal NULL_PTR, GPS_READWRITE Or GPS_OPENSLOWITEM, tIID, lpPs) <> S_OK Then
        Debug.Print "unable to get the property store from the file."
        GoTo Xit
    End If
    
    ' IPropertyStore::SetValue
    If vtblCall(lpPs, SetValue * PTR_LEN, vbLong, CC_STDCALL, _
         VarPtr(PropNameToPropKey(Prop)), VarPtr(CVar(Property_NewValue))) <> S_OK Then
        Debug.Print "unable to set the property value."
        GoTo ReleaseInterface
    End If
    
    ' IPropertyStore::Commit
    If vtblCall(lpPs, Commit * PTR_LEN, vbLong, CC_STDCALL) <> S_OK Then
        Debug.Print "unable to commit the property value."
        GoTo ReleaseInterface
    End If

    SetPropertyValue = True

ReleaseInterface:
    If lpPs Then
        ' IPropertyStore::Release
        Call vtblCall(lpPs, Release * PTR_LEN, vbLong, CC_STDCALL)
    End If

Xit:
    Call CoUninitialize

End Function

Public Function GetAllFileProperties(sPathFile As String) As String()

    Const CC_STDCALL = 4&, S_OK = 0&
    Const IID_PropertyStore = "{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99}"
    Const IID_IPropertyDescription = "{6f79d558-3e96-4549-a1d1-7d75d2288814}"
    
    Dim pkProp As PROPERTYKEY, tIID As GUID
    Dim lpPs As LongPtr, lpPd As LongPtr, lpStr As LongPtr
    Dim lpCanonicalName As LongPtr, lpDisplayName As LongPtr
    Dim sCanonicalName As String, sPropValue As String, sDisplayName As String
    Dim sTmpArray() As String, lPropCount As Long, i As Long

    If Len(Dir(sPathFile)) = 0& Then MsgBox "Invalid filepath.": Exit Function
    
    Call CoInitialize(NULL_PTR)

    Call CLSIDFromString(StrPtr(IID_PropertyStore), tIID)
        If SHGetPropertyStoreFromParsingName(StrPtr(sPathFile), ByVal 0&, GPS_DEFAULT Or GPS_BESTEFFORT Or GPS_OPENSLOWITEM, tIID, lpPs) <> S_OK Then
        'Debug.Print "Unable to get the property store for the given file."
        GoTo Xit
    End If

    'IPropertyStore::GetCount
    If vtblCall(lpPs, GetCount * PTR_LEN, vbLong, CC_STDCALL, VarPtr(lPropCount)) <> S_OK Then
        'Debug.Print "unable to get the properties count."
        GoTo ReleaseInterface
    End If

    If lPropCount Then
    
        ReDim sTmpArray(lPropCount, 0& To 2&)
        
        For i = 0& To lPropCount - 1&
        
            'IPropertyStore::GetAt
            If vtblCall(lpPs, GetAt * PTR_LEN, vbLong, CC_STDCALL, i, VarPtr(pkProp)) <> S_OK Then
                'Debug.Print "unable to get the property key from the property array of the item."
            End If
            
            If PSGetNameFromPropertyKey(pkProp, lpCanonicalName) <> S_OK Then
                'Debug.Print "Unable to retrieve the canonical name of the property."
            End If
            If lpCanonicalName Then
                sCanonicalName = CleanSTring(GetStrFromPtrW(lpCanonicalName))
                sTmpArray(i, 0&) = sCanonicalName
            Else
                sTmpArray(i, 0&) = "Unknown"
                'Debug.Print "Unknown CanonName."
            End If
            
            Call CLSIDFromString(StrPtr(IID_IPropertyDescription), tIID)
            If PSGetPropertyDescription(pkProp, tIID, lpPd) <> S_OK Then
                'Debug.Print "Unable to get an instance of the property description interface."
            End If
            
            'IPropertyDescription::GetDisplayName
            If vtblCall(lpPd, GetDisplayName * PTR_LEN, vbLong, CC_STDCALL, VarPtr(lpDisplayName)) <> S_OK Then
                'Debug.Print "Unable to get the display name of the property as it is shown in any UI."
            End If
            If lpDisplayName Then
                sDisplayName = CleanSTring(GetStrFromPtrW(lpDisplayName))
                sTmpArray(i, 1&) = sDisplayName
            Else
                sTmpArray(i, 1&) = "Unknown"
                'Debug.Print "Unknown DisplayName."
            End If
            
            If lpPs And lpPd Then
                If PSFormatPropertyValue(lpPs, lpPd, PDFF_DEFAULT, lpStr) <> S_OK Then
                    'Debug.Print "Unable to get the representation of a property value stored in a property store."
                End If
            End If
            If lpStr Then
                sPropValue = CleanSTring(GetStrFromPtrW(lpStr))
                sTmpArray(i, 2&) = sPropValue
            End If
'
            If lpPd Then
                'IPropertyDescription::Release
                Call vtblCall(lpPd, Release * PTR_LEN, vbLong, CC_STDCALL)
            End If
            GetAllFileProperties = sTmpArray
        
        Next i
    
    End If

ReleaseInterface:
    
    If lpPs Then
        'IPropertyStore::Release
        Call vtblCall(lpPs, Release * PTR_LEN, vbLong, CC_STDCALL)
    End If

Xit:
    Call CoUninitialize

End Function

Public Function PropertyDump() As String()

    Const S_OK = 0&, CC_STDCALL = 4&, PDEF_ALL = 3&
    Const IID_IPropertySystem = "{ca724e8a-c3e6-442b-88a4-6fb0db8035a3}"
    Const IID_IPropertyDescriptionList = "{1f9fc1d0-c39b-4b26-817f-011967d3440e}"
    Const IID_IPropertyDescription = "{6f79d558-3e96-4549-a1d1-7d75d2288814}"
    
    Dim lpPropSys As LongPtr, pPropList As LongPtr, pPropDescription As LongPtr
    Dim pPropName As LongPtr, pPropCanonicalName As LongPtr
    Dim sTmpArray() As String, tIID As GUID
    Dim sTmp As String, lPropCount As Long, i As Long

    Call CoInitialize(NULL_PTR)
    
    Call CLSIDFromString(StrPtr(IID_IPropertySystem), tIID)
    
    Call CoInitialize(NULL_PTR)
    
    If PSGetPropertySystem(tIID, lpPropSys) <> S_OK Then
        'Debug.Print "Unable to get an instance of the subsystem object that implements IPropertySystem."
        GoTo ReleaseInterface
    End If
    
    Call CLSIDFromString(StrPtr(IID_IPropertyDescriptionList), tIID)
    'IPropertySystem::EnumeratePropertyDescriptions
    If vtblCall(lpPropSys, EnumeratePropertyDescriptions * PTR_LEN, vbLong, CC_STDCALL, PDEF_ALL, VarPtr(tIID), VarPtr(pPropList)) <> S_OK Then
        'Debug.Print "Unable to get an instance of the subsystem object that implements IPropertyDescriptionList."
        GoTo ReleaseInterface
    End If
    
    'IPropertyDescriptionList::GetCount
    If vtblCall(pPropList, GetCount_ * PTR_LEN, vbLong, CC_STDCALL, VarPtr(lPropCount)) <> S_OK Then
        'Debug.Print "Unable to get the number of properties included in the property list."
        GoTo ReleaseInterface
    End If
    
    If lPropCount Then
    
        ReDim sTmpArray(lPropCount, 0& To 1&)
        
        For i = 0& To lPropCount - 1&
        
            Call CLSIDFromString(StrPtr(IID_IPropertyDescription), tIID)
            'IPropertyDescriptionList::GetAt
            If vtblCall(pPropList, GetAt_ * PTR_LEN, vbLong, CC_STDCALL, i, VarPtr(tIID), VarPtr(pPropDescription)) <> S_OK Then
                'Debug.Print "Unable to get the property description at the specified index in a property description list."
            End If
            
            'IPropertyDescription::GetDisplayName
            If vtblCall(pPropDescription, GetDisplayName * PTR_LEN, vbLong, CC_STDCALL, VarPtr(pPropName)) <> S_OK Then
                'Debug.Print "Unable to get the display name of the property as it is shown in any UI."
            End If
            
            'IPropertyDescription::GetCanonicalName
            If vtblCall(pPropDescription, GetCanonicalName * PTR_LEN, vbLong, CC_STDCALL, VarPtr(pPropCanonicalName)) <> S_OK Then
                'Debug.Print "Unable to get the case-sensitive name by which a property is known to the system, regardless of its localized name"
            End If
            
            sTmp = GetStrFromPtrW(pPropName)
            If Len(sTmp) Then
                sTmpArray(i, 0&) = sTmp
            Else
                sTmpArray(i, 0&) = "Unknown"
            End If
            sTmp = GetStrFromPtrW(pPropCanonicalName)
            sTmpArray(i, 1&) = sTmp
            PropertyDump = sTmpArray
            
            If pPropList Then
                'IPropertyDescription::Release
                Call vtblCall(pPropDescription, Release * PTR_LEN, vbLong, CC_STDCALL)
            End If
        
        Next i
    
    End If
    
ReleaseInterface:
    
    If pPropList Then
        'IPropertyDescriptionList::Release
        Call vtblCall(pPropList, Release * PTR_LEN, vbLong, CC_STDCALL)
    End If
    
    If lpPropSys Then
        'IPropertySystem::Release
        Call vtblCall(lpPropSys, Release * PTR_LEN, vbLong, CC_STDCALL)
    End If
    
Xit:
    Call CoUninitialize

End Function


' _____________________________________________ Private Routines _________________________________________

Private Function vtblCall( _
    ByVal InterfacePointer As LongPtr, _
    ByVal VTableOffset As Long, _
    ByVal FunctionReturnType As Long, _
    ByVal CallConvention As Long, _
    ParamArray FunctionParameters() As Variant _
) As Variant
        
    Dim vParamPtr() As LongPtr

    If InterfacePointer = 0& Or VTableOffset < 0& Then Exit Function
    If Not (FunctionReturnType And &HFFFF0000) = 0& Then Exit Function

    Dim pIndex As Long, pCount As Long
    Dim vParamType() As Integer
    Dim vRtn As Variant, vParams() As Variant

    vParams() = FunctionParameters()
    pCount = Abs(UBound(vParams) - LBound(vParams) + 1&)
    If pCount = 0& Then
        ReDim vParamPtr(0 To 0)
        ReDim vParamType(0 To 0)
    Else
        ReDim vParamPtr(0 To pCount - 1&)
        ReDim vParamType(0 To pCount - 1&)
        For pIndex = 0& To pCount - 1&
            vParamPtr(pIndex) = VarPtr(vParams(pIndex))
            vParamType(pIndex) = VarType(vParams(pIndex))
        Next
    End If

    pIndex = DispCallFunc(InterfacePointer, VTableOffset, CallConvention, FunctionReturnType, pCount, _
    vParamType(0), vParamPtr(0), vRtn)
    If pIndex = 0& Then
        vtblCall = vRtn
    Else
        SetLastError pIndex
    End If

End Function

'Private Function GetStrFromPtrW(ByVal lpString As LongPtr) As String
'   Dim lLength As Long, sBuffer As String
'   lLength = lstrlen(lpString)
'   sBuffer = Space$(lLength)
'   Call CopyMemory(ByVal StrPtr(sBuffer), ByVal lpString, lLength * 2&)
'   GetStrFromPtrW = sBuffer
'End Function

Private Function GetStrFromPtrW(ByVal lpString As LongPtr) As String
    Call SysReAllocString(VarPtr(GetStrFromPtrW), lpString)
    Call CoTaskMemFree(lpString)
End Function

Private Function CleanSTring(ByVal sStr As String) As String
    sStr = Replace(sStr, ChrW(&H200E), "")
    sStr = Replace(sStr, ChrW(&H200F), "")
    sStr = Replace(sStr, ChrW(&H202A), "")
    sStr = Replace(sStr, ChrW(&H202C), "")
    CleanSTring = sStr
End Function
 
Upvote 1
Code Section 2

2-
Helper code in a new Standard Module:
VBA Code:
Option Explicit

Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(0 To 7) As Byte
End Type

Private Type PROPERTYKEY
    fmtid As GUID
    pid As Long
End Type

Public Enum Property_Name

    AcquisitionID°
    Attributes°
    SizeOnDisk°
    Availability°
    OfflineStatus°
    ProgramName°
    Authors°
    Capacity°
    Categories°
    Comments°
    Company°
    ComputerName°
    ContentStatus°
    ContentType°
    Copyright°
    DateAccessed°
    DateAcquired°
    DateArchived°
    DateCompleted°
    DateCreated°
    DateImported°
    DateModified°
    DueDate°
    EndDate°
    Filename°
    FileAttributes°
    FileDescription°
    FileExtension°
    FileCount°
    FileFRN°
    Owner°
    FileVersion°
    FlagColor°
    FlagColorText°
    FlagStatus°
    FlagStatusText°
    Identity°
    Importance°
    ImportanceText°
    IsAttachment°
    IsDeleted°
    IsFlagged°
    IsFlaggedComplete°
    IsIncomplete°
    IsRead°
    IsShared°
    ItemAuthors°
    ItemDate°
    ItemFolderNameDisplay°
    FolderPath°
    ItemFolderPathDisplayNarrow°
    Name°
    ItemNameDisplay°
    ItemNamePrefix°
    ItemParticipants°
    ItemPathDisplay°
    ItemPathDisplayNarrow°
    ItemType°
    ItemTypeText°
    ItemUrl°
    TagsKeywords°
    Kind°
    KindText°
    Language°
    MileageInformation°
    MIMEType°
    OriginalFileName°
    ParentalRating°
    ParentalRatingReason°
    ParsingName°
    Priority°
    PriorityText°
    Project°
    ProviderItemID°
    '// Rating Indicates the users preference rating of an item on a scale of 0-99 (0 = unrated, 1-12 = One Star,
   ' //13-37 = Two Stars, 38-62 = Three Stars, 63-87 = Four Stars, 88-99 = Five Stars).
    Rating°
    RatingText°
    Sensitivity°
    SensitivityText°
    SFGAOFlags°
    SharedWith°
    ShellOmitFromView°
    Size°
    SoftwareUsed°
    SourceItem°
    StartDate°
    Status°
    Subject°
    ThumbnailCacheId°
    Title°
    Length°
    
    Protected°
    Document_ByteCount°
    Document_CharacterCount°
    Document_ClientID°
    Document_Contributor°
    Document_DateContentCreated°
    Document_DatePrinted°
    Document_DateLastSaved°
    Document_Division°
    Document_DocumentID°
    Document_HiddenSlideCount°
    Document_LastSavedBy°
    Document_LineCount°
    Document_LinksDirty°
    Document_Manager°
    Document_MultimediaClipCount°
    Document_NoteCount°
    Document_PageCount°
    Document_ParagraphCount°
    Document_PresentationFormat°
    Document_RevisionNumber°
    Document_Scale°
    Document_Security°
    Document_SlideCount°
    Document_Template°
    Document_TotalEditingTime°
    Document_VersionNumber°
    Document_WordCount°
    
    Image_BitDepth°
    Image_Compression°
    Image_CompressionText°
    Image_Dimensions°
    Image_HorizontalResolution°
    Image_Width°
    Image_VerticalResolution°
    Image_Height°
    Image_ColourRepresentation°
    Image_Compressedbitsperpixel°
    Image_ImageID°
    Image_ResolutionUnit°

    Photo_Aperture°
    Photo_ApertureDenominator°
    Photo_ApertureNumerator°
    Photo_Brightness°
    Photo_BrightnessDenominator°
    Photo_BrightnessNumerator°
    Photo_CameraMaker°
    Photo_CameraModel°
    Photo_CameraSerialNumber°
    Photo_Contrast°
    Photo_ContrastText°
    Photo_DateTaken°
    Photo_DigitalZoom°
    Photo_DigitalZoomDenominator°
    Photo_DigitalZoomNumerator°
    Photo_EXIFVersion°
    Photo_Event°
    Photo_ExposureBias°
    Photo_ExposureBiasDenominator°
    Photo_ExposureBiasNumerator°
    Photo_ExposureIndex°
    Photo_ExposureIndexDenominator°
    Photo_ExposureIndexNumerator°
    Photo_ExposureProgram°
    Photo_ExposureProgramText°
    Photo_ExposureTime°
    Photo_ExposureTimeDenominator°
    Photo_ExposureTimeNumerator°
    Photo_FNumber°
    Photo_FNumberDenominator°
    Photo_FNumberNumerator°
    Photo_Flash°
    Photo_FlashEnergy°
    Photo_FlashEnergyDenominator°
    Photo_FlashEnergyNumerator°
    Photo_FlashFired°
    Photo_FlashMaker°
    Photo_FlashModel°
    Photo_FlashText°
    Photo_FocalLength°
    Photo_FocalLengthDenominator°
    Photo_FocalLengthInFilm°
    Photo_FocalLengthNumerator°
    Photo_FocalPlaneXResolution°
    Photo_FocalPlaneXResolutionDenominator°
    Photo_FocalPlaneXResolutionNumerator°
    Photo_FocalPlaneYResolution°
    Photo_FocalPlaneYResolutionDenominator°
    Photo_FocalPlaneYResolutionNumerator°
    Photo_GainControl°
    Photo_GainControlDenominator°
    Photo_GainControlNumerator°
    Photo_GainControlText°
    Photo_ISOSpeed°
    Photo_LensManufacturer°
    Photo_LensModel°
    Photo_LightSource°
    Photo_MakerNote°
    Photo_MakerNoteOffset°
    Photo_MaxAperture°
    Photo_MaxApertureDenominator°
    Photo_MaxApertureNumerator°
    Photo_MeteringMode°
    Photo_MeteringModeText°
    Photo_Orientation°
    Photo_OrientationText°
    Photo_PeopleNames°
    Photo_PhotometricInterpretation°
    Photo_PhotometricInterpretationText°
    Photo_ProgramMode°
    Photo_ProgramModeText°
    Photo_RelatedSoundFile°
    Photo_Saturation°
    Photo_SaturationText°
    Photo_Sharpness°
    Photo_SharpnessText°
    Photo_ShutterSpeed°
    Photo_ShutterSpeedDenominator°
    Photo_ShutterSpeedNumerator°
    Photo_SubjectDistance°
    Photo_SubjectDistanceDenominator°
    Photo_SubjectDistanceNumerator°
    Photo_TagViewAggregate°
    Photo_TranscodedForSync°
    Photo_WhiteBalance°
    Photo_WhiteBalanceText°
    
    Media_AuthorUrl°
    Media_AverageLevel°
    Media_ClassPrimaryID°
    Media_ClassSecondaryID°
    Media_CollectionGroupID°
    Media_CollectionID°
    Media_ContentDistributor°
    Media_ContentID°
    Media_CreatorApplication°
    Media_CreatorApplicationVersion°
    Media_DVDID°
    Media_DateEncoded°
    Media_DateReleased°
    Media_DlnaProfileID°
    Media_Duration°
    Media_EncodedBy°
    Media_EncodingSettings°
    Media_EpisodeNumber°
    Media_FrameCount°
    Media_MCDI°
    Media_MetadataContentProvider°
    Media_Producer°
    Media_PromotionUrl°
    Media_ProtectionType°
    Media_ProviderRating°
    Media_ProviderStyle°
    Media_Publisher°
    Media_SeasonNumber°
    Media_SeriesName°
    Media_Status°
    Media_SubTitle°
    Media_SubscriptionContentId°
    Media_ThumbnailLargePath°
    Media_ThumbnailLargeUri°
    Media_ThumbnailSmallPath°
    Media_ThumbnailSmallUri°
    Media_UniqueFileIdentifier°
    Media_UserNoAutoInfo°
    Media_UserWebUrl°
    Media_Writers°
    Media_Year°
    
    Music_AlbumArtistSortOverride°
    Music_AlbumArtist°
    Music_Album°
    Music_AlbumTitleSortOverride°
    Music_ContributingArtists°
    Music_ArtistSortOverride°
    Music_BeatsPerMinute°
    Music_Composer°
    Music_ComposerSortOverride°
    Music_Conductor°
    Music_GroupDescription°
    Music_DiscNumber°
    Music_DisplayArtist°
    Music_Genre°
    Music_InitialKey°
    Music_Lyrics°
    Music_Mood°
    Music_PartOfSet°
    Music_Period°
    Music_SynchronizedLyrics°
    Music_TrackNumber°
    MusicStackThumbnailCacheIds°
    
    Audio_ChannelCount°
    Audio_Compression°
    Audio_Bitrate°
    Audio_Format°
    Audio_IsVariableBitRate°
    Audio_PeakValue°
    Audio_SampleRate°
    Audio_SampleSize°
    Audio_StreamName°
    Audio_StreamNumber°
    
    Video_Compression°
    Video_Directors°
    Video_DataRate°
    Video_FourCC°
    Video_FrameHeight°
    Video_FrameRate°
    Video_FrameWidth°
    Video_HorizontalAspectRatio°
    Video_IsSpherical°
    Video_IsStereo°
    Video_Orientation°
    Video_SampleSize°
    Video_StreamName°
    Video_StreamNumber°
    Video_TotalBitrate°
    Video_TranscodedForSync°
    Video_VerticalAspectRatio°
    
End Enum


Public Function DisplayNameToCanonicalName(ByVal DisplyName As Property_Name) As String

    Select Case DisplyName
    
        Case AcquisitionID°:                           DisplayNameToCanonicalName = "System.AcquisitionID"
        Case Attributes°:                              DisplayNameToCanonicalName = "System.FileAttributes"
        Case SizeOnDisk°:                              DisplayNameToCanonicalName = "System.FileAllocationSize"
        Case OfflineStatus°:                           DisplayNameToCanonicalName = "System.OfflineStatus"
        Case Availability°:                            DisplayNameToCanonicalName = "System.OfflineAvailability"
        Case ProgramName°:                             DisplayNameToCanonicalName = "System.ApplicationName"
        Case Authors°:                                 DisplayNameToCanonicalName = "System.Author"
        Case Categories°:                              DisplayNameToCanonicalName = "System.Category"
        Case Comments°:                                DisplayNameToCanonicalName = "System.Comment"
        Case Company°:                                 DisplayNameToCanonicalName = "System.Company"
        Case Capacity°:                                DisplayNameToCanonicalName = "System.Capacity"
        Case ComputerName°:                            DisplayNameToCanonicalName = "System.ComputerName"
        Case ContentStatus°:                           DisplayNameToCanonicalName = "System.ContentStatus"
        Case ContentType°:                             DisplayNameToCanonicalName = "System.ContentType"
        Case Copyright°:                               DisplayNameToCanonicalName = "System.Copyright"
        Case DateAccessed°:                            DisplayNameToCanonicalName = "System.DateAccessed"
        Case DateAcquired°:                            DisplayNameToCanonicalName = "System.DateAcquired"
        Case DateArchived°:                            DisplayNameToCanonicalName = "System.DateArchived"
        Case DateCompleted°:                           DisplayNameToCanonicalName = "System.DateCompleted"
        Case DateCreated°:                             DisplayNameToCanonicalName = "System.DateCreated"
        Case DateImported°:                            DisplayNameToCanonicalName = "System.DateImported"
        Case DateModified°:                            DisplayNameToCanonicalName = "System.DateModified"
        Case DueDate°:                                 DisplayNameToCanonicalName = "System.DueDate"
        Case EndDate°:                                 DisplayNameToCanonicalName = "System.EndDate"
        Case FileAttributes°:                          DisplayNameToCanonicalName = "System.FileAttributes"
        Case FileDescription°:                         DisplayNameToCanonicalName = "System.FileDescription"
        Case FileExtension°:                           DisplayNameToCanonicalName = "System.FileExtension"
        Case FileCount°:                               DisplayNameToCanonicalName = "System.FileCount"
        Case FileFRN°:                                 DisplayNameToCanonicalName = "System.FileFRN"
        Case Owner°:                                   DisplayNameToCanonicalName = "System.FileOwner"
        Case Filename°:                                DisplayNameToCanonicalName = "System.FileName"
        Case FileVersion°:                             DisplayNameToCanonicalName = "System.FileVersion"
        Case FlagColor°:                               DisplayNameToCanonicalName = "System.FlagColor"
        Case FlagColorText°:                           DisplayNameToCanonicalName = "System.FlagColorText"
        Case FlagStatus°:                              DisplayNameToCanonicalName = "System.FlagStatus"
        Case FlagStatusText°:                          DisplayNameToCanonicalName = "System.FlagStatusText"
        Case Identity°:                                DisplayNameToCanonicalName = "System.Identity"
        Case Importance°:                              DisplayNameToCanonicalName = "System.Importance"
        Case ImportanceText°:                          DisplayNameToCanonicalName = "System.ImportanceText°"
        Case IsAttachment°:                            DisplayNameToCanonicalName = "System.IsAttachment"
        Case IsDeleted°:                               DisplayNameToCanonicalName = "System.IsDeleted"
        Case IsFlagged°:                               DisplayNameToCanonicalName = "System.IsFlagged"
        Case IsFlaggedComplete°:                       DisplayNameToCanonicalName = "System.IsFlaggedComplete"
        Case IsIncomplete°:                            DisplayNameToCanonicalName = "System.IsIncomplete"
        Case IsRead°:                                  DisplayNameToCanonicalName = "System.IsRead"
        Case IsShared°:                                DisplayNameToCanonicalName = "System.IsShared"
        Case ItemAuthors°:                             DisplayNameToCanonicalName = "System.ItemAuthors"
        Case ItemDate°:                                DisplayNameToCanonicalName = "System.ItemDate"
        Case ItemFolderNameDisplay°:                   DisplayNameToCanonicalName = "System.ItemFolderNameDisplay"
        Case FolderPath°:                              DisplayNameToCanonicalName = "System.ItemFolderPathDisplay"
        Case ItemFolderPathDisplayNarrow°:             DisplayNameToCanonicalName = "System.ItemFolderPathDisplayNarrow"
        Case Name°:                                    DisplayNameToCanonicalName = "System.ItemName"
        Case ItemNameDisplay°:                         DisplayNameToCanonicalName = "System.ItemNameDisplay"
        Case ItemNamePrefix°:                          DisplayNameToCanonicalName = "System.ItemNamePrefix"
        Case ItemParticipants°:                        DisplayNameToCanonicalName = "System.ItemParticipants"
        Case ItemPathDisplay°:                         DisplayNameToCanonicalName = "System.ItemPathDisplay"
        Case ItemPathDisplayNarrow°:                   DisplayNameToCanonicalName = "System.ItemPathDisplayNarrow"
        Case ItemType°:                                DisplayNameToCanonicalName = "System.ItemType"
        Case ItemTypeText°:                            DisplayNameToCanonicalName = "System.ItemTypeText"
        Case ItemUrl°:                                 DisplayNameToCanonicalName = "System.ItemUrl"
        Case TagsKeywords°:                            DisplayNameToCanonicalName = "System.Keywords"
        Case Kind°:                                    DisplayNameToCanonicalName = "System.Kind"
        Case KindText°:                                DisplayNameToCanonicalName = "System.KindText"
        Case Language°:                                DisplayNameToCanonicalName = "System.Language"
        Case MileageInformation°:                      DisplayNameToCanonicalName = "System.MileageInformation"
        Case MIMEType°:                                DisplayNameToCanonicalName = "System.MIMEType"
        Case OriginalFileName°:                        DisplayNameToCanonicalName = "System.OriginalFileName"
        Case ParentalRating°:                          DisplayNameToCanonicalName = "System.ParentalRating"
        Case ParentalRatingReason°:                    DisplayNameToCanonicalName = "System.ParentalRatingReason"
        Case ParsingName°:                             DisplayNameToCanonicalName = "System.ParsingName"
        Case Priority°:                                DisplayNameToCanonicalName = "System.Priority"
        Case PriorityText°:                            DisplayNameToCanonicalName = "System.PriorityText"
        Case Project°:                                 DisplayNameToCanonicalName = "System.Project"
        Case ProviderItemID°:                          DisplayNameToCanonicalName = "System.ProviderItemID"
        Case Rating°:                                  DisplayNameToCanonicalName = "System.Rating"
        Case RatingText°:                              DisplayNameToCanonicalName = "System.RatingText"
        Case Sensitivity°:                             DisplayNameToCanonicalName = "System.Sensitivity"
        Case SensitivityText°:                         DisplayNameToCanonicalName = "System.SensitivityText"
        Case SFGAOFlags°:                              DisplayNameToCanonicalName = "System.SFGAOFlags"
        Case SharedWith°:                              DisplayNameToCanonicalName = "System.SharedWith"
        Case ShellOmitFromView°:                       DisplayNameToCanonicalName = "System.ShellOmitFromView"
        Case Size°:                                    DisplayNameToCanonicalName = "System.Size"
        Case SoftwareUsed°:                            DisplayNameToCanonicalName = "System.SoftwareUsed"
        Case SourceItem°:                              DisplayNameToCanonicalName = "System.SourceItem"
        Case StartDate°:                               DisplayNameToCanonicalName = "System.StartDate"
        Case Status°:                                  DisplayNameToCanonicalName = "System.Status"
        Case Subject°:                                 DisplayNameToCanonicalName = "System.Subject"
        Case ThumbnailCacheId°:                        DisplayNameToCanonicalName = "System.ThumbnailCacheId"
        Case Title°:                                   DisplayNameToCanonicalName = "System.Title"
        Case Protected°:                               DisplayNameToCanonicalName = "System.DRM.IsProtected"
        Case Length°:                                  DisplayNameToCanonicalName = "System.Media.Duration"
        
        Case Document_ByteCount°:                      DisplayNameToCanonicalName = "System.Document.ByteCount"
        Case Document_CharacterCount°:                 DisplayNameToCanonicalName = "System.Document.CharacterCount"
        Case Document_ClientID°:                       DisplayNameToCanonicalName = "System.Document.ClientID"
        Case Document_Contributor°:                    DisplayNameToCanonicalName = "System.Document.Contributor"
        Case Document_DateContentCreated°:             DisplayNameToCanonicalName = "System.Document.DateCreated"
        Case Document_DatePrinted°:                    DisplayNameToCanonicalName = "System.Document.DatePrinted"
        Case Document_DateLastSaved°:                  DisplayNameToCanonicalName = "System.Document.DateSaved"
        Case Document_Division°:                       DisplayNameToCanonicalName = "System.Document.Division"
        Case Document_DocumentID°:                     DisplayNameToCanonicalName = "System.Document.DocumentID"
        Case Document_HiddenSlideCount°:               DisplayNameToCanonicalName = "System.Document.HiddenSlideCount"
        Case Document_LastSavedBy°:                    DisplayNameToCanonicalName = "System.Document.LastAuthor"
        Case Document_LineCount°:                      DisplayNameToCanonicalName = "System.Document.LineCount"
        Case Document_LinksDirty°:                     DisplayNameToCanonicalName = "System.Document.LinksDirty"
        Case Document_Manager°:                        DisplayNameToCanonicalName = "System.Document.Manager"
        Case Document_MultimediaClipCount°:            DisplayNameToCanonicalName = "System.Document.MultimediaClipCount"
        Case Document_NoteCount°:                      DisplayNameToCanonicalName = "System.Document.NoteCount"
        Case Document_PageCount°:                      DisplayNameToCanonicalName = "System.Document.PageCount"
        Case Document_ParagraphCount°:                 DisplayNameToCanonicalName = "System.Document.ParagraphCount"
        Case Document_PresentationFormat°:             DisplayNameToCanonicalName = "System.Document.PresentationFormat"
        Case Document_RevisionNumber°:                 DisplayNameToCanonicalName = "System.Document.RevisionNumber"
        Case Document_Scale°:                          DisplayNameToCanonicalName = "System.Document.Scale"
        Case Document_Security°:                       DisplayNameToCanonicalName = "System.Document.Security"
        Case Document_SlideCount°:                     DisplayNameToCanonicalName = "System.Document.SlideCount"
        Case Document_Template°:                       DisplayNameToCanonicalName = "System.Document.Template"
        Case Document_TotalEditingTime°:               DisplayNameToCanonicalName = "System.Document.TotalEditingTime"
        Case Document_VersionNumber°:                  DisplayNameToCanonicalName = "System.Document.Version"
        Case Document_WordCount°:                      DisplayNameToCanonicalName = "System.Document.WordCount"
    
        Case Image_BitDepth°:                          DisplayNameToCanonicalName = "System.Image.BitDepth"
        Case Image_Compression°:                       DisplayNameToCanonicalName = "System.Image.Compression"
        Case Image_CompressionText°:                   DisplayNameToCanonicalName = "System.Image.CompressionText"
        Case Image_Dimensions°:                        DisplayNameToCanonicalName = "System.Image.Dimensions"
        Case Image_HorizontalResolution°:              DisplayNameToCanonicalName = "System.Image.HorizontalResolution"
        Case Image_Width°:                             DisplayNameToCanonicalName = "System.Image.HorizontalSize"
        Case Image_VerticalResolution°:                DisplayNameToCanonicalName = "System.Image.VerticalResolution"
        Case Image_Height°:                            DisplayNameToCanonicalName = "System.Image.VerticalSize"
        Case Image_ColourRepresentation°:              DisplayNameToCanonicalName = "System.Image.ColorSpace"
        Case Image_Compressedbitsperpixel°:            DisplayNameToCanonicalName = "System.Image.CompressedBitsPerPixel"
        Case Image_ImageID°:                           DisplayNameToCanonicalName = "System.Image.ImageID"
        Case Image_ResolutionUnit°:                    DisplayNameToCanonicalName = "System.Image.ResolutionUnit"
        
    
        Case Photo_Aperture°:                          DisplayNameToCanonicalName = "System.Photo.Aperture"
        Case Photo_ApertureDenominator°:               DisplayNameToCanonicalName = "System.Photo.ApertureDenominator"
        Case Photo_ApertureNumerator°:                 DisplayNameToCanonicalName = "System.Photo.ApertureNumerator"
        Case Photo_Brightness°:                        DisplayNameToCanonicalName = "System.Photo.Brightness"
        Case Photo_BrightnessDenominator°:             DisplayNameToCanonicalName = "System.Photo.BrightnessDenominator"
        Case Photo_BrightnessNumerator°:               DisplayNameToCanonicalName = "System.Photo.BrightnessNumerator"
        Case Photo_CameraMaker°:                DisplayNameToCanonicalName = "System.Photo.CameraManufacturer"
        Case Photo_CameraModel°:                       DisplayNameToCanonicalName = "System.Photo.CameraModel"
        Case Photo_CameraSerialNumber°:                DisplayNameToCanonicalName = "System.Photo.CameraSerialNumber"
        Case Photo_Contrast°:                          DisplayNameToCanonicalName = "System.Photo.Contrast"
        Case Photo_ContrastText°:                      DisplayNameToCanonicalName = "System.Photo.ContrastText"
        Case Photo_DateTaken°:                         DisplayNameToCanonicalName = "System.Photo.DateTaken"
        Case Photo_DigitalZoom°:                       DisplayNameToCanonicalName = "System.Photo.DigitalZoom"
        Case Photo_DigitalZoomDenominator°:            DisplayNameToCanonicalName = "System.Photo.DigitalZoomDenominator"
        Case Photo_DigitalZoomNumerator°:              DisplayNameToCanonicalName = "System.Photo.DigitalZoomNumerator"
        Case Photo_EXIFVersion°:                       DisplayNameToCanonicalName = "System.Photo.EXIFVersion"
        Case Photo_Event°:                             DisplayNameToCanonicalName = "System.Photo.Event"
        Case Photo_ExposureBias°:                      DisplayNameToCanonicalName = "System.Photo.ExposureBias"
        Case Photo_ExposureBiasDenominator°:           DisplayNameToCanonicalName = "System.Photo.ExposureBiasDenominator"
        Case Photo_ExposureBiasNumerator°:             DisplayNameToCanonicalName = "System.Photo.ExposureBiasNumerator"
        Case Photo_ExposureIndex°:                     DisplayNameToCanonicalName = "System.Photo.ExposureIndex"
        Case Photo_ExposureIndexDenominator°:          DisplayNameToCanonicalName = "System.Photo.ExposureIndexDenominator"
        Case Photo_ExposureIndexNumerator°:            DisplayNameToCanonicalName = "System.Photo.ExposureIndexNumerator"
        Case Photo_ExposureProgram°:                   DisplayNameToCanonicalName = "System.Photo.ExposureProgram"
        Case Photo_ExposureProgramText°:               DisplayNameToCanonicalName = "System.Photo.ExposureProgramText"
        Case Photo_ExposureTime°:                      DisplayNameToCanonicalName = "System.Photo.ExposureTime"
        Case Photo_ExposureTimeDenominator°:           DisplayNameToCanonicalName = "System.Photo.ExposureTimeDenominator"
        Case Photo_ExposureTimeNumerator°:             DisplayNameToCanonicalName = "System.Photo.ExposureTimeNumerator"
        Case Photo_FNumber°:                           DisplayNameToCanonicalName = "System.Photo.FNumber"
        Case Photo_FNumberDenominator°:                DisplayNameToCanonicalName = "System.Photo.FNumberDenominator"
        Case Photo_FNumberNumerator°:                  DisplayNameToCanonicalName = "System.Photo.FNumberNumerator"
        Case Photo_Flash°:                             DisplayNameToCanonicalName = "System.Photo.Flash"
        Case Photo_FlashEnergy°:                       DisplayNameToCanonicalName = "System.Photo.FlashEnergy"
        Case Photo_FlashEnergyDenominator°:            DisplayNameToCanonicalName = "System.Photo.FlashEnergyDenominator"
        Case Photo_FlashEnergyNumerator°:              DisplayNameToCanonicalName = "System.Photo.FlashEnergyNumerator"
        Case Photo_FlashFired°:                        DisplayNameToCanonicalName = "System.Photo.FlashFired"
        Case Photo_FlashMaker°:                 DisplayNameToCanonicalName = "System.Photo.FlashManufacturer"
        Case Photo_FlashModel°:                        DisplayNameToCanonicalName = "System.Photo.FlashModel"
        Case Photo_FlashText°:                         DisplayNameToCanonicalName = "System.Photo.FlashText"
        Case Photo_FocalLength°:                       DisplayNameToCanonicalName = "System.Photo.FocalLength"
        Case Photo_FocalLengthDenominator°:            DisplayNameToCanonicalName = "System.Photo.FocalLengthDenominator"
        Case Photo_FocalLengthInFilm°:                 DisplayNameToCanonicalName = "System.Photo.FocalLengthInFilm"
        Case Photo_FocalLengthNumerator°:              DisplayNameToCanonicalName = "System.Photo.FocalLengthNumerator"
        Case Photo_FocalPlaneXResolution°:             DisplayNameToCanonicalName = "System.Photo.FocalPlaneXResolution"
        Case Photo_FocalPlaneXResolutionDenominator°:  DisplayNameToCanonicalName = "System.Photo.FocalPlaneXResolutionDenominator"
        Case Photo_FocalPlaneXResolutionNumerator°:    DisplayNameToCanonicalName = "System.Photo.FocalPlaneXResolutionNumerator"
        Case Photo_FocalPlaneYResolution°:             DisplayNameToCanonicalName = "System.Photo.FocalPlaneYResolution"
        Case Photo_FocalPlaneYResolutionDenominator°:  DisplayNameToCanonicalName = "System.Photo.FocalPlaneYResolutionDenominator"
        Case Photo_FocalPlaneYResolutionNumerator°:    DisplayNameToCanonicalName = "System.Photo.FocalPlaneYResolutionNumerator"
        Case Photo_GainControl°:                       DisplayNameToCanonicalName = "System.Photo.GainControl"
        Case Photo_GainControlDenominator°:            DisplayNameToCanonicalName = "System.Photo.GainControlDenominator"
        Case Photo_GainControlNumerator°:              DisplayNameToCanonicalName = "System.Photo.GainControlNumerator"
        Case Photo_GainControlText°:                   DisplayNameToCanonicalName = "System.Photo.GainControlText"
        Case Photo_ISOSpeed°:                          DisplayNameToCanonicalName = "System.Photo.ISOSpeed"
        Case Photo_LensManufacturer°:                  DisplayNameToCanonicalName = "System.Photo.LensManufacturer"
        Case Photo_LensModel°:                         DisplayNameToCanonicalName = "System.Photo.LensModel"
        Case Photo_LightSource°:                       DisplayNameToCanonicalName = "System.Photo.LightSource"
        Case Photo_MakerNote°:                         DisplayNameToCanonicalName = "System.Photo.MakerNote"
        Case Photo_MakerNoteOffset°:                   DisplayNameToCanonicalName = "System.Photo.MakerNoteOffset"
        Case Photo_MaxAperture°:                       DisplayNameToCanonicalName = "System.Photo.MaxAperture"
        Case Photo_MaxApertureDenominator°:            DisplayNameToCanonicalName = "System.Photo.MaxApertureDenominator"
        Case Photo_MaxApertureNumerator°:              DisplayNameToCanonicalName = "System.Photo.MaxApertureNumerator"
        Case Photo_MeteringMode°:                      DisplayNameToCanonicalName = "System.Photo.MeteringMode"
        Case Photo_MeteringModeText°:                  DisplayNameToCanonicalName = "System.Photo.MeteringModeText"
        Case Photo_Orientation°:                       DisplayNameToCanonicalName = "System.Photo.Orientation"
        Case Photo_OrientationText°:                   DisplayNameToCanonicalName = "System.Photo.OrientationText"
        Case Photo_PeopleNames°:                       DisplayNameToCanonicalName = "System.Photo.PeopleNames"
        Case Photo_PhotometricInterpretation°:         DisplayNameToCanonicalName = "System.Photo.PhotometricInterpretation"
        Case Photo_PhotometricInterpretationText°:     DisplayNameToCanonicalName = "System.Photo.PhotometricInterpretationText"
        Case Photo_ProgramMode°:                       DisplayNameToCanonicalName = "System.Photo.ProgramMode"
        Case Photo_ProgramModeText°:                   DisplayNameToCanonicalName = "System.Photo.ProgramModeText"
        Case Photo_RelatedSoundFile°:                  DisplayNameToCanonicalName = "System.Photo.RelatedSoundFile"
        Case Photo_Saturation°:                        DisplayNameToCanonicalName = "System.Photo.Saturation"
        Case Photo_SaturationText°:                    DisplayNameToCanonicalName = "System.Photo.SaturationText"
        Case Photo_Sharpness°:                         DisplayNameToCanonicalName = "System.Photo.Sharpness"
        Case Photo_SharpnessText°:                     DisplayNameToCanonicalName = "System.Photo.SharpnessText"
        Case Photo_ShutterSpeed°:                      DisplayNameToCanonicalName = "System.Photo.ShutterSpeed"
        Case Photo_ShutterSpeedDenominator°:           DisplayNameToCanonicalName = "System.Photo.ShutterSpeedDenominator"
        Case Photo_ShutterSpeedNumerator°:             DisplayNameToCanonicalName = "System.Photo.ShutterSpeedNumerator"
        Case Photo_SubjectDistance°:                   DisplayNameToCanonicalName = "System.Photo.SubjectDistance"
        Case Photo_SubjectDistanceDenominator°:        DisplayNameToCanonicalName = "System.Photo.SubjectDistanceDenominator"
        Case Photo_SubjectDistanceNumerator°:          DisplayNameToCanonicalName = "System.Photo.SubjectDistanceNumerator"
        Case Photo_TagViewAggregate°:                  DisplayNameToCanonicalName = "System.Photo.TagViewAggregate"
        Case Photo_TranscodedForSync°:                 DisplayNameToCanonicalName = "System.Photo.TranscodedForSync"
        Case Photo_WhiteBalance°:                      DisplayNameToCanonicalName = "System.Photo.WhiteBalance"
        Case Photo_WhiteBalanceText°:                  DisplayNameToCanonicalName = "System.Photo.WhiteBalanceText"
    
        Case Media_AuthorUrl°:                         DisplayNameToCanonicalName = "System.Media.AuthorUrl"
        Case Media_AverageLevel°:                      DisplayNameToCanonicalName = "System.Media.AverageLevel"
        Case Media_ClassPrimaryID°:                    DisplayNameToCanonicalName = "System.Media.ClassPrimaryID"
        Case Media_ClassSecondaryID°:                  DisplayNameToCanonicalName = "System.Media.ClassSecondaryID"
        Case Media_CollectionGroupID°:                 DisplayNameToCanonicalName = "System.Media.CollectionGroupID"
        Case Media_CollectionID°:                      DisplayNameToCanonicalName = "System.Media.CollectionID"
        Case Media_ContentDistributor°:                DisplayNameToCanonicalName = "System.Media.ContentDistributor"
        Case Media_ContentID°:                         DisplayNameToCanonicalName = "System.Media.ContentID"
        Case Media_CreatorApplication°:                DisplayNameToCanonicalName = "System.Media.CreatorApplication"
        Case Media_CreatorApplicationVersion°:         DisplayNameToCanonicalName = "System.Media.CreatorApplicationVersion"
        Case Media_DVDID°:                             DisplayNameToCanonicalName = "System.Media.DVDID"
        Case Media_DateEncoded°:                       DisplayNameToCanonicalName = "System.Media.DateEncoded"
        Case Media_DateReleased°:                      DisplayNameToCanonicalName = "System.Media.DateReleased"
        Case Media_DlnaProfileID°:                     DisplayNameToCanonicalName = "System.Media.DlnaProfileID"
        Case Media_Duration°:                          DisplayNameToCanonicalName = "System.Media.Duration"
        Case Media_EncodedBy°:                         DisplayNameToCanonicalName = "System.Media.EncodedBy"
        Case Media_EncodingSettings°:                  DisplayNameToCanonicalName = "System.Media.EncodingSettings"
        Case Media_EpisodeNumber°:                     DisplayNameToCanonicalName = "System.Media.EpisodeNumber"
        Case Media_FrameCount°:                        DisplayNameToCanonicalName = "System.Media.FrameCount"
        Case Media_MCDI°:                              DisplayNameToCanonicalName = "System.Media.MCDI"
        Case Media_MetadataContentProvider°:           DisplayNameToCanonicalName = "System.Media.MetadataContentProvider"
        Case Media_Producer°:                          DisplayNameToCanonicalName = "System.Media.Producer"
        Case Media_PromotionUrl°:                      DisplayNameToCanonicalName = "System.Media.PromotionUrl"
        Case Media_ProtectionType°:                    DisplayNameToCanonicalName = "System.Media.ProtectionType"
        Case Media_ProviderRating°:                    DisplayNameToCanonicalName = "System.Media.ProviderRating"
        Case Media_ProviderStyle°:                     DisplayNameToCanonicalName = "System.Media.ProviderStyle"
        Case Media_Publisher°:                         DisplayNameToCanonicalName = "System.Media.Publisher"
        Case Media_SeasonNumber°:                      DisplayNameToCanonicalName = "System.Media.SeasonNumber"
        Case Media_SeriesName°:                        DisplayNameToCanonicalName = "System.Media.SeriesName"
        Case Media_Status°:                            DisplayNameToCanonicalName = "System.Media.Status"
        Case Media_SubTitle°:                          DisplayNameToCanonicalName = "System.Media.SubTitle"
        Case Media_SubscriptionContentId°:             DisplayNameToCanonicalName = "System.Media.SubscriptionContentId"
        Case Media_ThumbnailLargePath°:                DisplayNameToCanonicalName = "System.Media.ThumbnailLargePath"
        Case Media_ThumbnailLargeUri°:                 DisplayNameToCanonicalName = "System.Media.ThumbnailLargeUri"
        Case Media_ThumbnailSmallPath°:                DisplayNameToCanonicalName = "System.Media.ThumbnailSmallPath"
        Case Media_ThumbnailSmallUri°:                 DisplayNameToCanonicalName = "System.Media.ThumbnailSmallUri"
        Case Media_UniqueFileIdentifier°:              DisplayNameToCanonicalName = "System.Media.UniqueFileIdentifier"
        Case Media_UserNoAutoInfo°:                    DisplayNameToCanonicalName = "System.Media.UserNoAutoInfo"
        Case Media_UserWebUrl°:                        DisplayNameToCanonicalName = "System.Media.UserWebUrl"
        Case Media_Writers°:                            DisplayNameToCanonicalName = "System.Media.Writer"
        Case Media_Year°:                              DisplayNameToCanonicalName = "System.Media.Year"
        
        Case Music_AlbumArtistSortOverride°:           DisplayNameToCanonicalName = "System.Music.AlbumArtistSortOverride"
        Case Music_AlbumArtist°:                       DisplayNameToCanonicalName = "System.Music.AlbumID"
        Case Music_Album°:                             DisplayNameToCanonicalName = "System.Music.AlbumTitle"
        Case Music_AlbumTitleSortOverride°:            DisplayNameToCanonicalName = "System.Music.AlbumTitleSortOverride"
        Case Music_ContributingArtists°:               DisplayNameToCanonicalName = "System.Music.Artist"
        Case Music_ArtistSortOverride°:                DisplayNameToCanonicalName = "System.Music.ArtistSortOverride"
        Case Music_BeatsPerMinute°:                    DisplayNameToCanonicalName = "System.Music.BeatsPerMinute"
        Case Music_Composer°:                          DisplayNameToCanonicalName = "System.Music.Composer"
        Case Music_ComposerSortOverride°:              DisplayNameToCanonicalName = "System.Music.ComposerSortOverride"
        Case Music_Conductor°:                         DisplayNameToCanonicalName = "System.Music.Conductor"
        Case Music_GroupDescription°:           DisplayNameToCanonicalName = "System.Music.ContentGroupDescription"
        Case Music_DiscNumber°:                        DisplayNameToCanonicalName = "System.Music.DiscNumber"
        Case Music_DisplayArtist°:                     DisplayNameToCanonicalName = "System.Music.DisplayArtist"
        Case Music_Genre°:                             DisplayNameToCanonicalName = "System.Music.Genre"
        Case Music_InitialKey°:                        DisplayNameToCanonicalName = "System.Music.InitialKey"
        Case Music_Lyrics°:                            DisplayNameToCanonicalName = "System.Music.Lyrics"
        Case Music_Mood°:                              DisplayNameToCanonicalName = "System.Music.Mood"
        Case Music_PartOfSet°:                         DisplayNameToCanonicalName = "System.Music.PartOfSet"
        Case Music_Period°:                            DisplayNameToCanonicalName = "System.Music.Period"
        Case Music_SynchronizedLyrics°:                DisplayNameToCanonicalName = "System.Music.SynchronizedLyrics"
        Case Music_TrackNumber°:                       DisplayNameToCanonicalName = "System.Music.TrackNumber"
    
        Case Audio_ChannelCount°:                      DisplayNameToCanonicalName = "System.Audio.ChannelCount"
        Case Audio_Compression°:                       DisplayNameToCanonicalName = "System.Audio.Compression"
        Case Audio_Bitrate°:                           DisplayNameToCanonicalName = "System.Audio.EncodingBitrate"
        Case Audio_Format°:                            DisplayNameToCanonicalName = "System.Audio.Format"
        Case Audio_IsVariableBitRate°:                 DisplayNameToCanonicalName = "System.Audio.IsVariableBitRate"
        Case Audio_PeakValue°:                         DisplayNameToCanonicalName = "System.Audio.PeakValue"
        Case Audio_SampleRate°:                        DisplayNameToCanonicalName = "System.Audio.SampleRate"
        Case Audio_SampleSize°:                        DisplayNameToCanonicalName = "System.Audio.SampleSize"
        Case Audio_StreamName°:                        DisplayNameToCanonicalName = "System.Audio.StreamName"
        Case Audio_StreamNumber°:                      DisplayNameToCanonicalName = "System.Audio.StreamNumber"
    
        Case Video_Compression°:                       DisplayNameToCanonicalName = "System.Video.Compression"
        Case Video_Directors°:                         DisplayNameToCanonicalName = "System.Video.Director"
        Case Video_DataRate°:                          DisplayNameToCanonicalName = "System.Video.EncodingBitrate"
        Case Video_FourCC°:                            DisplayNameToCanonicalName = "System.Video.FourCC"
        Case Video_FrameHeight°:                       DisplayNameToCanonicalName = "System.Video.FrameHeight"
        Case Video_FrameRate°:                         DisplayNameToCanonicalName = "System.Video.FrameRate"
        Case Video_FrameWidth°:                        DisplayNameToCanonicalName = "System.Video.FrameWidth"
        Case Video_HorizontalAspectRatio°:             DisplayNameToCanonicalName = "System.Video.HorizontalAspectRatio"
        Case Video_IsSpherical°:                       DisplayNameToCanonicalName = "System.Video.IsSpherical"
        Case Video_IsStereo°:                          DisplayNameToCanonicalName = "System.Video.IsStereo"
        Case Video_Orientation°:                       DisplayNameToCanonicalName = "System.Video.Orientation"
        Case Video_SampleSize°:                        DisplayNameToCanonicalName = "System.Video.SampleSize"
        Case Video_StreamName°:                        DisplayNameToCanonicalName = "System.Video.StreamName"
        Case Video_StreamNumber°:                      DisplayNameToCanonicalName = "System.Video.StreamNumber"
        Case Video_TotalBitrate°:                      DisplayNameToCanonicalName = "System.Video.TotalBitrate"
        Case Video_TranscodedForSync°:                 DisplayNameToCanonicalName = "System.Video.TranscodedForSync"
        Case Video_VerticalAspectRatio°:               DisplayNameToCanonicalName = "System.Video.VerticalAspectRatio"
    
    End Select

End Function


Public Function PropNameToPropKey(ByVal PrpName As Property_Name) As PROPERTYKEY

    Select Case PrpName
        
        Case AcquisitionID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H65A98875, &H3C80, &H40AB, &HAB, &HBC, &HEF, &HDA, &HF7, &H7D, &HBE, &HE2, 100)
        Case ProgramName°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF29F85E0, &H4FF9, &H1068, &HAB, &H91, &H8, &H0, &H2B, &H27, &HB3, &HD9, 18)
        Case Authors°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF29F85E0, &H4FF9, &H1068, &HAB, &H91, &H8, &H0, &H2B, &H27, &HB3, &HD9, 4)
        Case Capacity°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H9B174B35, &H40FF, &H11D2, &HA2, &H7E, &H0, &HC0, &H4F, &HC3, &H8, &H71, 3)
        Case Categories°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HD5CDD502, &H2E9C, &H101B, &H93, &H97, &H8, &H0, &H2B, &H2C, &HF9, &HAE, 2)
        Case Comments°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF29F85E0, &H4FF9, &H1068, &HAB, &H91, &H8, &H0, &H2B, &H27, &HB3, &HD9, 6)
        Case Company°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HD5CDD502, &H2E9C, &H101B, &H93, &H97, &H8, &H0, &H2B, &H2C, &HF9, &HAE, 15)
        Case ComputerName°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H28636AA6, &H953D, &H11D2, &HB5, &HD6, &H0, &HC0, &H4F, &HD9, &H18, &HD0, 5)
        Case ContentStatus°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HD5CDD502, &H2E9C, &H101B, &H93, &H97, &H8, &H0, &H2B, &H2C, &HF9, &HAE, 27)
        Case ContentType°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HD5CDD502, &H2E9C, &H101B, &H93, &H97, &H8, &H0, &H2B, &H2C, &HF9, &HAE, 26)
        Case Copyright°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 11)
        Case DateAccessed°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HB725F130, &H47EF, &H101A, &HA5, &HF1, &H2, &H60, &H8C, &H9E, &HEB, &HAC, 16)
        Case DateAcquired°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H2CBAA8F5, &HD81F, &H47CA, &HB1, &H7A, &HF8, &HD8, &H22, &H30, &H1, &H31, 100)
        Case DateArchived°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H43F8D7B7, &HA444, &H4F87, &H93, &H83, &H52, &H27, &H1C, &H9B, &H91, &H5C, 100)
        Case DateCompleted°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H72FAB781, &HACDA, &H43E5, &HB1, &H55, &HB2, &H43, &H4F, &H85, &HE6, &H78, 100)
        Case DateCreated°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HB725F130, &H47EF, &H101A, &HA5, &HF1, &H2, &H60, &H8C, &H9E, &HEB, &HAC, 15)
        Case DateImported°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 18258)
        Case DateModified°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HB725F130, &H47EF, &H101A, &HA5, &HF1, &H2, &H60, &H8C, &H9E, &HEB, &HAC, 14)
        Case DueDate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H3F8472B5, &HE0AF, &H4DB2, &H80, &H71, &HC5, &H3F, &HE7, &H6A, &HE7, &HCE, 100)
        Case EndDate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HC75FAA05, &H96FD, &H49E7, &H9C, &HB4, &H9F, &H60, &H10, &H82, &HD5, &H53, 100)
        Case SizeOnDisk°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HB725F130, &H47EF, &H101A, &HA5, &HF1, &H2, &H60, &H8C, &H9E, &HEB, &HAC, 18)
        Case FileAttributes°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HB725F130, &H47EF, &H101A, &HA5, &HF1, &H2, &H60, &H8C, &H9E, &HEB, &HAC, 13)
        Case FileCount°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H28636AA6, &H953D, &H11D2, &HB5, &HD6, &H0, &HC0, &H4F, &HD9, &H18, &HD0, 12)
        Case FileDescription°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HCEF7D53, &HFA64, &H11D1, &HA2, &H3, &H0, &H0, &HF8, &H1F, &HED, &HEE, 3)
        Case FileExtension°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE4F10A3C, &H49E6, &H405D, &H82, &H88, &HA2, &H3B, &HD4, &HEE, &HAA, &H6C, 100)
        Case FileFRN°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HB725F130, &H47EF, &H101A, &HA5, &HF1, &H2, &H60, &H8C, &H9E, &HEB, &HAC, 21)
        Case Filename°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H41CF5AE0, &HF75A, &H4806, &HBD, &H87, &H59, &HC7, &HD9, &H24, &H8E, &HB9, 100)
        Case Owner°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H9B174B34, &H40FF, &H11D2, &HA2, &H7E, &H0, &HC0, &H4F, &HC3, &H8, &H71, 4)
        Case FileVersion°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HCEF7D53, &HFA64, &H11D1, &HA2, &H3, &H0, &H0, &HF8, &H1F, &HED, &HEE, 4)
        Case FlagColor°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H67DF94DE, &HCA7, &H4D6F, &HB7, &H92, &H5, &H3A, &H3E, &H4F, &H3, &HCF, 100)
        Case FlagColorText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H45EAE747, &H8E2A, &H40AE, &H8C, &HBF, &HCA, &H52, &HAB, &HA6, &H15, &H2A, 100)
        Case FlagStatus°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE3E0584C, &HB788, &H4A5A, &HBB, &H20, &H7F, &H5A, &H44, &HC9, &HAC, &HDD, 12)
        Case FlagStatusText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HDC54FD2E, &H189D, &H4871, &HAA, &H1, &H8, &HC2, &HF5, &H7A, &H4A, &HBC, 100)
        Case Identity°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HA26F4AFC, &H7346, &H4299, &HBE, &H47, &HEB, &H1A, &HE6, &H13, &H13, &H9F, 100)
        Case Importance°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE3E0584C, &HB788, &H4A5A, &HBB, &H20, &H7F, &H5A, &H44, &HC9, &HAC, &HDD, 11)
        Case ParentalRating°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 21)
        Case Rating°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 9)
        Case TagsKeywords°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF29F85E0, &H4FF9, &H1068, &HAB, &H91, &H8, &H0, &H2B, &H27, &HB3, &HD9, 5)
        Case Language°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HD5CDD502, &H2E9C, &H101B, &H93, &H97, &H8, &H0, &H2B, &H2C, &HF9, &HAE, 28)
        Case Title°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF29F85E0, &H4FF9, &H1068, &HAB, &H91, &H8, &H0, &H2B, &H27, &HB3, &HD9, 2)
        Case Name°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6B8DA074, &H3B5C, &H43BC, &H88, &H6F, &HA, &H2C, &HDC, &HE0, &HB, &H6F, 100)
    
    
        Case Media_AuthorUrl°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 32)
        Case Media_AverageLevel°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H9EDD5B6, &HB301, &H43C5, &H99, &H90, &HD0, &H3, &H2, &HEF, &HFD, &H46, 100)
        Case Media_ClassPrimaryID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 13)
        Case Media_ClassSecondaryID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 14)
        Case Media_CollectionGroupID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 24)
        Case Media_CollectionID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 25)
        Case Media_ContentDistributor°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 18)
        Case Media_ContentID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 26)
        Case Media_CreatorApplication°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 27)
        Case Media_CreatorApplicationVersion°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 28)
        Case Media_DateEncoded°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H2E4B640D, &H5019, &H46D8, &H88, &H81, &H55, &H41, &H4C, &HC5, &HCA, &HA0, 100)
        Case Media_DateReleased°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HDE41CC29, &H6971, &H4290, &HB4, &H72, &HF5, &H9F, &H2E, &H2F, &H31, &HE2, 100)
        Case Media_DlnaProfileID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HCFA31B45, &H525D, &H4998, &HBB, &H44, &H3F, &H7D, &H81, &H54, &H2F, &HA4, 100)
        Case Media_Duration°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 3)
        Case Media_DVDID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 15)
        Case Media_EncodedBy°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 36)
        Case Media_EncodingSettings°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 37)
        Case Media_EpisodeNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 100)
        Case Media_FrameCount°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6444048F, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 12)
        Case Media_MCDI°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 16)
        Case Media_MetadataContentProvider°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 17)
        Case Media_Producer°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 22)
        Case Media_PromotionUrl°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 33)
        Case Media_ProtectionType°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 38)
        Case Media_ProviderRating°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 39)
        Case Media_ProviderStyle°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 40)
        Case Media_Publisher°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 30)
        Case Media_SeasonNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 101)
        Case Media_SeriesName°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 42)
        Case Media_SubscriptionContentId°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H9AEBAE7A, &H9644, &H487D, &HA9, &H2C, &H65, &H75, &H85, &HED, &H75, &H1A, 100)
        Case Media_SubTitle°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 38)
        Case Media_ThumbnailLargePath°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 47)
        Case Media_ThumbnailLargeUri°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 48)
        Case Media_ThumbnailSmallPath°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 49)
        Case Media_ThumbnailSmallUri°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 50)
        Case Media_UniqueFileIdentifier°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 35)
        Case Media_UserNoAutoInfo°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 41)
        Case Media_UserWebUrl°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 34)
        Case Media_Writers°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 23)
        Case Media_Year°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 5)
    
    
        Case Audio_ChannelCount°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H80, &H8, &H0, &H36, &HB1, &H1A, &H3, 7)
        Case Audio_Compression°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H80, &H8, &H0, &H36, &HB1, &H1A, &H3, 10)
        Case Audio_Bitrate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 4)
        Case Audio_Format°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H80, &H8, &H0, &H36, &HB1, &H1A, &H3, 2)
        Case Audio_IsVariableBitRate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE6822FEE, &H8C17, &H4D62, &H82, &H3C, &H8E, &H9C, &HFC, &HBD, &H1D, &H5C, 100)
        Case Audio_PeakValue°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H2579E5D0, &H1116, &H4084, &HBD, &H9A, &H9B, &H4F, &H7C, &HB4, &HDF, &H5E, 100)
        Case Audio_SampleRate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H80, &H8, &H0, &H36, &HB1, &H1A, &H3, 5)
        Case Audio_SampleSize°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H80, &H8, &H0, &H36, &HB1, &H1A, &H3, 6)
        Case Audio_StreamName°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H80, &H8, &H0, &H36, &HB1, &H1A, &H3, 9)
        Case Audio_StreamNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440490, &H4C8B, &H11D1, &H8B, &H80, &H8, &H0, &H36, &HB1, &H1A, &H3, 8)
    
    
        Case Music_AlbumArtist°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 13)
        Case Music_AlbumArtistSortOverride°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF1FDB4AF, &HF78C, &H466C, &HBB, &H5, &H56, &HE9, &H2D, &HB0, &HB8, &HEC, 103)
        Case Music_Album°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 4)
        Case Music_AlbumTitleSortOverride°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H13EB7FFC, &HEC89, &H4346, &HB1, &H9D, &HCC, &HC6, &HF1, &H78, &H42, &H23, 101)
        Case Music_ContributingArtists°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 2)
        Case Music_ArtistSortOverride°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HDEEB2DB5, &H696, &H4CE0, &H94, &HFE, &HA0, &H1F, &H77, &HA4, &H5F, &HB5, 102)
        Case Music_BeatsPerMinute°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 35)
        Case Music_Composer°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 19)
        Case Music_ComposerSortOverride°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HBC20A3, &HBD48, &H4085, &H87, &H2C, &HA8, &H8D, &H77, &HF5, &H9, &H7E, 105)
        Case Music_Conductor°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 36)
        Case Music_GroupDescription°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 33)
        Case Music_DiscNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6AFE7437, &H9BCD, &H49C7, &H80, &HFE, &H4A, &H5C, &H65, &HFA, &H58, &H74, 104)
        Case Music_DisplayArtist°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HFD122953, &HFA93, &H4EF7, &H92, &HC3, &H4, &HC9, &H46, &HB2, &HF7, &HC8, 100)
        Case Music_Genre°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 11)
        Case Music_InitialKey°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 34)
        Case Music_Lyrics°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 12)
        Case Music_Mood°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 39)
        Case Music_PartOfSet°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 37)
        Case Music_Period°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 31)
        Case Music_SynchronizedLyrics°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6B223B6A, &H162E, &H4AA9, &HB3, &H9F, &H5, &HD6, &H78, &HFC, &H6D, &H77, 100)
        Case Music_TrackNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H56A3372E, &HCE9C, &H11D2, &H9F, &HE, &H0, &H60, &H97, &HC6, &H86, &HF6, 7)
    
    
        Case Video_Compression°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 10)
        Case Video_Directors°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440492, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 20)
        Case Video_DataRate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 8)
        Case Video_FourCC°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 44)
        Case Video_FrameHeight°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 4)
        Case Video_FrameRate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 6)
        Case Video_FrameWidth°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 3)
        Case Video_HorizontalAspectRatio°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 42)
        Case Video_IsSpherical°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 100)
        Case Video_IsStereo°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 98)
        Case Video_Orientation°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 99)
        Case Video_SampleSize°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 9)
        Case Video_StreamName°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 2)
        Case Video_StreamNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 11)
        Case Video_TotalBitrate°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 43)
        Case Video_TranscodedForSync°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 46)
        Case Video_VerticalAspectRatio°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H64440491, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 45)
    
    
        Case Image_BitDepth°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6444048F, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 7)
        Case Image_Compression°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 259)
        Case Image_CompressionText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H3F08E66F, &H2F44, &H4BB9, &HA6, &H82, &HAC, &H35, &HD2, &H56, &H23, &H22, 100)
        Case Image_Dimensions°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6444048F, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 13)
        Case Image_HorizontalResolution°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6444048F, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 5)
        Case Image_Width°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6444048F, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 3)
        Case Image_VerticalResolution°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6444048F, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 6)
        Case Image_Height°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6444048F, &H4C8B, &H11D1, &H8B, &H70, &H8, &H0, &H36, &HB1, &H1A, &H3, 4)
        Case Image_ColourRepresentation°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 40961)
        Case Image_Compressedbitsperpixel°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H364B6FA9, &H37AB, &H482A, &HBE, &H2B, &HAE, &H2, &HF6, &HD, &H43, &H18, 100)
        Case Image_ImageID°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H10DABE05, &H32AA, &H4C29, &HBF, &H1A, &H63, &HE2, &HD2, &H20, &H58, &H7F, 100)
        Case Image_ResolutionUnit°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H19B51FA6, &H1F92, &H4A5C, &HAB, &H48, &H7D, &HF0, &HAB, &HD6, &H74, &H44, 100)
        
        
        Case Photo_Aperture°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37378)
        Case Photo_ApertureDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE1A9A38B, &H6685, &H46BD, &H87, &H5E, &H57, &HD, &HC7, &HAD, &H73, &H20, 100)
        Case Photo_ApertureNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H337ECEC, &H39FB, &H4581, &HA0, &HBD, &H4C, &H4C, &HC5, &H1E, &H99, &H14, 100)
        Case Photo_Brightness°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H1A701BF6, &H478C, &H4361, &H83, &HAB, &H37, &H1, &HBB, &H5, &H3C, &H58, 100)
        Case Photo_BrightnessNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H9E7D118F, &HB314, &H45A0, &H8C, &HFB, &HD6, &H54, &HB9, &H17, &HC9, &HE9, 100)
        Case Photo_CameraMaker°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 271)
        Case Photo_CameraModel°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 272)
        Case Photo_CameraSerialNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 273)
        Case Photo_Contrast°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H2A785BA9, &H8D23, &H4DED, &H82, &HE6, &H60, &HA3, &H50, &HC8, &H6A, &H10, 100)
        Case Photo_ContrastText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H59DDE9F2, &H5253, &H40EA, &H9A, &H8B, &H47, &H9E, &H96, &HC6, &H24, &H9A, 100)
        Case Photo_DateTaken°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 36867)
        Case Photo_DigitalZoom°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF85BF840, &HA925, &H4BC2, &HB0, &HC4, &H8E, &H36, &HB5, &H98, &H67, &H9E, 100)
        Case Photo_DigitalZoomDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H745BAF0E, &HE5C1, &H4CFB, &H8A, &H1B, &HD0, &H31, &HA0, &HA5, &H23, &H93, 100)
        Case Photo_DigitalZoomNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H16CBB924, &H6500, &H473B, &HA5, &HBE, &HF1, &H59, &H9B, &HCB, &HE4, &H13, 100)
        Case Photo_Event°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 18248)
        Case Photo_EXIFVersion°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HD35F743A, &HEB2E, &H47F2, &HA2, &H86, &H84, &H41, &H32, &HCB, &H14, &H27, 100)
        Case Photo_ExposureBias°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37380)
        Case Photo_ExposureBiasDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HAB205E50, &H4B7, &H461C, &HA1, &H8C, &H2F, &H23, &H38, &H36, &HE6, &H27, 100)
        Case Photo_ExposureBiasNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H738BF284, &H1D87, &H420B, &H92, &HCF, &H58, &H34, &HBF, &H6E, &HF9, &HED, 100)
        Case Photo_ExposureIndex°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H967B5AF8, &H995A, &H46ED, &H9E, &H11, &H35, &HB3, &HC5, &HB9, &H78, &H2D, 100)
        Case Photo_ExposureIndexDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H93112F89, &HC28B, &H492F, &H8A, &H9D, &H4B, &HE2, &H6, &H2C, &HEE, &H8A, 100)
        Case Photo_ExposureIndexNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HCDEDCF30, &H8919, &H44DF, &H8F, &H4C, &H4E, &HB2, &HFF, &HDB, &H8D, &H89, 100)
        Case Photo_ExposureProgram°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 34850)
        Case Photo_ExposureProgramText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HFEC690B7, &H5F30, &H4646, &HAE, &H47, &H4C, &HAA, &HFB, &HA8, &H84, &HA3, 100)
        Case Photo_ExposureTime°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 33434)
        Case Photo_ExposureTimeDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H55E98597, &HAD16, &H42E0, &HB6, &H24, &H21, &H59, &H9A, &H19, &H98, &H38, 100)
        Case Photo_ExposureTimeNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H257E44E2, &H9031, &H4323, &HAC, &H38, &H85, &HC5, &H52, &H87, &H1B, &H2E, 100)
        Case Photo_Flash°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37385)
        Case Photo_FlashEnergy°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 41483)
        Case Photo_FlashEnergyDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HD7B61C70, &H6323, &H49CD, &HA5, &HFC, &HC8, &H42, &H77, &H16, &H2C, &H97, 100)
        Case Photo_FlashEnergyNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HFCAD3D3D, &H858, &H400F, &HAA, &HA3, &H2F, &H66, &HCC, &HE2, &HA6, &HBC, 100)
        Case Photo_FlashMaker°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HAABAF6C9, &HE0C5, &H4719, &H85, &H85, &H57, &HB1, &H3, &HE5, &H84, &HFE, 100)
        Case Photo_FlashModel°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HFE83BB35, &H4D1A, &H42E2, &H91, &H6B, &H6, &HF3, &HE1, &HAF, &H71, &H9E, 100)
        Case Photo_FlashText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6B8B68F6, &H200B, &H47EA, &H8D, &H25, &HD8, &H5, &HF, &H57, &H33, &H9F, 100)
        Case Photo_FNumber°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 33437)
        Case Photo_FNumberDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE92A2496, &H223B, &H4463, &HA4, &HE3, &H30, &HEA, &HBB, &HA7, &H9D, &H80, 100)
        Case Photo_FNumberNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H1B97738A, &HFDFC, &H462F, &H9D, &H93, &H19, &H57, &HE0, &H8B, &HE9, &HC, 100)
        Case Photo_FocalLength°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37386)
        Case Photo_FocalLengthDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H305BC615, &HDCA1, &H44A5, &H9F, &HD4, &H10, &HC0, &HBA, &H79, &H41, &H2E, 100)
        Case Photo_FocalLengthInFilm°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HA0E74609, &HB84D, &H4F49, &HB8, &H60, &H46, &H2B, &HD9, &H97, &H1F, &H98, 100)
        Case Photo_FocalLengthNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H776B6B3B, &H1E3D, &H4B0C, &H9A, &HE, &H8F, &HBA, &HF2, &HA8, &H49, &H2A, 100)
        Case Photo_FocalPlaneXResolutionDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H933F3F5, &H4786, &H4F46, &HA8, &HE8, &HD6, &H4D, &HD3, &H7F, &HA5, &H21, 100)
        Case Photo_FocalPlaneXResolutionNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HDCCB10AF, &HB4E2, &H4B88, &H95, &HF9, &H3, &H1B, &H4D, &H5A, &HB4, &H90, 100)
        Case Photo_FocalPlaneYResolution°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H4FFFE4D0, &H914F, &H4AC4, &H8D, &H6F, &HC9, &HC6, &H1D, &HE1, &H69, &HB1, 100)
        Case Photo_FocalPlaneYResolutionDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H1D6179A6, &HA876, &H4031, &HB0, &H13, &H33, &H47, &HB2, &HB6, &H4D, &HC8, 100)
        Case Photo_FocalPlaneYResolutionNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HA2E541C5, &H4440, &H4BA8, &H86, &H7E, &H75, &HCF, &HC0, &H68, &H28, &HCD, 100)
        Case Photo_GainControl°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HFA304789, &HC7, &H4D80, &H90, &H4A, &H1E, &H4D, &HCC, &H72, &H65, &HAA, 100)
        Case Photo_GainControlDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H42864DFD, &H9DA4, &H4F77, &HBD, &HED, &H4A, &HAD, &H7B, &H25, &H67, &H35, 100)
        Case Photo_GainControlNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H8E8ECF7C, &HB7B8, &H4EB8, &HA6, &H3F, &HE, &HE7, &H15, &HC9, &H6F, &H9E, 100)
        Case Photo_GainControlText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HC06238B2, &HBF9, &H4279, &HA7, &H23, &H25, &H85, &H67, &H15, &HCB, &H9D, 100)
        Case Photo_ISOSpeed°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 34855)
        Case Photo_LensManufacturer°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE6DDCAF7, &H29C5, &H4F0A, &H9A, &H68, &HD1, &H94, &H12, &HEC, &H70, &H90, 100)
        Case Photo_LensModel°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE1277516, &H2B5F, &H4869, &H89, &HB1, &H2E, &H58, &H5B, &HD3, &H8B, &H7A, 100)
        Case Photo_LightSource°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37384)
        Case Photo_MakerNoteOffset°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H813F4124, &H34E6, &H4D17, &HAB, &H3E, &H6B, &H1F, &H3C, &H22, &H47, &HA1, 100)
        Case Photo_MaxAperture°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H8F6D7C2, &HE3F2, &H44FC, &HAF, &H1E, &H5A, &HA5, &HC8, &H1A, &H2D, &H3E, 100)
        Case Photo_MaxApertureDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HC77724D4, &H601F, &H46C5, &H9B, &H89, &HC5, &H3F, &H93, &HBC, &HEB, &H77, 100)
        Case Photo_MaxApertureNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HC107E191, &HA459, &H44C5, &H9A, &HE6, &HB9, &H52, &HAD, &H4B, &H90, &H6D, 100)
        Case Photo_MeteringMode°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37383)
        Case Photo_MeteringModeText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HF628FD8C, &H7BA8, &H465A, &HA6, &H5B, &HC5, &HAA, &H79, &H26, &H3A, &H9E, 100)
        Case Photo_Orientation°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 274)
        Case Photo_OrientationText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HA9EA193C, &HC511, &H498A, &HA0, &H6B, &H58, &HE2, &H77, &H6D, &HCC, &H28, 100)
        Case Photo_PhotometricInterpretation°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H341796F1, &H1DF9, &H4B1C, &HA5, &H64, &H91, &HBD, &HEF, &HA4, &H38, &H77, 100)
        Case Photo_PhotometricInterpretationText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H821437D6, &H9EAB, &H4765, &HA5, &H89, &H3B, &H1C, &HBB, &HD2, &H2A, &H61, 100)
        Case Photo_ProgramMode°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6D217F6D, &H3F6A, &H4825, &HB4, &H70, &H5F, &H3, &HCA, &H2F, &HBE, &H9B, 100)
        Case Photo_ProgramModeText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H7FE3AA27, &H2648, &H42F3, &H89, &HB0, &H45, &H4E, &H5C, &HB1, &H50, &HC3, 100)
        Case Photo_RelatedSoundFile°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H318A6B45, &H87F, &H4DC2, &HB8, &HCC, &H5, &H35, &H95, &H51, &HFC, &H9E, 100)
        Case Photo_Saturation°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H49237325, &HA95A, &H4F67, &HB2, &H11, &H81, &H6B, &H2D, &H45, &HD2, &HE0, 100)
        Case Photo_SaturationText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H61478C08, &HB600, &H4A84, &HBB, &HE4, &HE9, &H9C, &H45, &HF0, &HA0, &H72, 100)
        Case Photo_Sharpness°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HFC6976DB, &H8349, &H4970, &HAE, &H97, &HB3, &HC5, &H31, &H6A, &H8, &HF0, 100)
        Case Photo_SharpnessText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H51EC3F47, &HDD50, &H421D, &H87, &H69, &H33, &H4F, &H50, &H42, &H4B, &H1E, 100)
        Case Photo_ShutterSpeed°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37377)
        Case Photo_ShutterSpeedDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HE13D8975, &H81C7, &H4948, &HAE, &H3F, &H37, &HCA, &HE1, &H1E, &H8F, &HF7, 100)
        Case Photo_ShutterSpeedNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H16EA4042, &HD6F4, &H4BCA, &H83, &H49, &H7C, &H78, &HD3, &HF, &HB3, &H33, 100)
        Case Photo_SubjectDistance°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H14B81DA1, &H135, &H4D31, &H96, &HD9, &H6C, &HBF, &HC9, &H67, &H1A, &H99, 37382)
        Case Photo_SubjectDistanceDenominator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HC840A88, &HB043, &H466D, &H97, &H66, &HD4, &HB2, &H6D, &HA3, &HFA, &H77, 100)
        Case Photo_SubjectDistanceNumerator°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H8AF4961C, &HF526, &H43E5, &HAA, &H81, &HDB, &H76, &H82, &H19, &H17, &H8D, 100)
        Case Photo_TranscodedForSync°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H9A8EBB75, &H6458, &H4E82, &HBA, &HCB, &H35, &HC0, &H9, &H5B, &H3, &HBB, 100)
        Case Photo_WhiteBalance°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&HEE3D3D8A, &H5381, &H4CFA, &HB1, &H3B, &HAA, &HF6, &H6B, &H5F, &H4E, &HC9, 100)
        Case Photo_WhiteBalanceText°
    PropNameToPropKey = DEFINE_PROPERTYKEY(&H6336B95E, &HC7A7, &H426D, &H86, &HFD, &H7A, &HE3, &HD3, &H9C, &H84, &HB4, 100)
    
    End Select

End Function

Private Function DEFINE_PROPERTYKEY( _
    l As Long, _
    w1 As Integer, _
    w2 As Integer, _
    B0 As Byte, _
    b1 As Byte, _
    b2 As Byte, _
    B3 As Byte, _
    b4 As Byte, _
    b5 As Byte, _
    b6 As Byte, _
    b7 As Byte, _
    pid As Long _
) As PROPERTYKEY

    Dim tPk As PROPERTYKEY
    
    With tPk.fmtid
        .Data1 = l
        .Data2 = w1
        .Data3 = w2
        .Data4(0) = B0
        .Data4(1) = b1
        .Data4(2) = b2
        .Data4(3) = B3
        .Data4(4) = b4
        .Data4(5) = b5
        .Data4(6) = b6
        .Data4(7) = b7
    End With
    tPk.pid = pid
    DEFINE_PROPERTYKEY = tPk
 
End Function
 
Upvote 1
3- Code Usage Example:

VBA Code:
Sub Test1()

    'Getting a few property values from a file.
    Const FILE_PATH_NAME = "C:\Users\IME.xlsm"  '<< change patname to suit
    Dim sOutput As String
    
    If Len(Dir(FILE_PATH_NAME)) Then
        sOutput = "Reading some file properties" & vbLf
        sOutput = sOutput & "===================" & vbLf & vbLf
        sOutput = sOutput & "-Name:    " & GetPropertyValue(FILE_PATH_NAME, Name°) & vbLf
        sOutput = sOutput & "-Date Created:   " & GetPropertyValue(FILE_PATH_NAME, DateCreated°) & vbLf
        sOutput = sOutput & "-Comments:   " & GetPropertyValue(FILE_PATH_NAME, Comments°) & vbLf
        sOutput = sOutput & "-File Type:   " & GetPropertyValue(FILE_PATH_NAME, ItemType°) & vbLf
        sOutput = sOutput & "-Date Last Saved:   " & GetPropertyValue(FILE_PATH_NAME, Document_DateLastSaved°) & vbLf
        sOutput = sOutput & "-Last Saved By:   " & GetPropertyValue(FILE_PATH_NAME, Document_LastSavedBy°)
        MsgBox sOutput
    Else
        MsgBox "Invalid filename"
    End If

End Sub

Sub Test2()

    'Editing a few editable properties in a file.
    Const FILE_PATH_NAME = "C:\Users\hp\Pictures\MyPhoto.jpg"  '<< change patname to suit
    
    If Len(Dir(FILE_PATH_NAME)) Then
        Debug.Print SetPropertyValue(FILE_PATH_NAME, Photo_DateTaken°, #8/16/2030 3:35:45 PM#)
        Debug.Print SetPropertyValue(FILE_PATH_NAME, Photo_CameraMaker°, "Whatever ...")
        Debug.Print SetPropertyValue(FILE_PATH_NAME, Authors°, "Nobody!")
        Debug.Print SetPropertyValue(FILE_PATH_NAME, TagsKeywords°, "A-B-C-D")
        '0 = unrated, 1-12 = One Star,13-37 = Two Stars, 38-62 = Three Stars,
        '63-87 = Four Stars, 88-99 = Five Stars)
        Debug.Print SetPropertyValue(FILE_PATH_NAME, Rating°, 88)
    End If

End Sub

Sub Test3()

    'Dumping properties in a new worksheet. (may be slow!!!)
    Dim sTmp() As String
    
    sTmp = PropertyDump()
    Worksheets.Add
    Range("a2:b" & UBound(sTmp) + 1) = PropertyDump()
    [a1].Parent.Name = "Property Dump " & Int(Rnd() * 1000)
    [a1:B1].EntireColumn.AutoFit
    [a1:B1].Font.Bold = True
    [a1] = "Canonical Name": [b1] = "Display Name"
    
    MsgBox "Total System Properties found: " & UBound(sTmp)

End Sub

Private Sub CommandButton1_Click()

    'Open a file and read its properties.
    Dim sFilepath As String
    sFilepath = Application.GetOpenFilename()
    If sFilepath <> "False" Then
        With ListBox1
            .ColumnHeads = True
            .ColumnCount = 3
            .ColumnWidths = "200,150,250"
            .List = GetAllFileProperties(sFilepath)
        End With
        Label5.Visible = True
        Label4.Caption = sFilepath
    End If
    
End Sub
 
Upvote 1
Jaafar, please, please excuse me as I am not much of a programmer, however I was able to follow much of this excellent post. I thought that I would mention two items that I encountered when testing the demo xlsm spreadsheet on my Win 10, MS 365 64x system. First, the function GetStrFromPtrW wouldn't work, but when I switched it back to the original (commented out) code in the demo, that code worked. Second, I was unable to set the Subject property on an image file and low and behold I noticed that that specific property was missing in the PropNameToPropKey function so it did not recieve a call to the DEFINE_PROPERTYKEY function. I added one and now it seems to work perfectly. Thank you for a serious amount of effort for folks like me trying to do some VBA edititing of extended file properties.
 
Upvote 0
Jaafar, please, please excuse me as I am not much of a programmer, however I was able to follow much of this excellent post. I thought that I would mention two items that I encountered when testing the demo xlsm spreadsheet on my Win 10, MS 365 64x system. First, the function GetStrFromPtrW wouldn't work, but when I switched it back to the original (commented out) code in the demo, that code worked. Second, I was unable to set the Subject property on an image file and low and behold I noticed that that specific property was missing in the PropNameToPropKey function so it did not recieve a call to the DEFINE_PROPERTYKEY function. I added one and now it seems to work perfectly. Thank you for a serious amount of effort for folks like me trying to do some VBA edititing of extended file properties.
@65goat

Sorry for not responding to your post earlier. I have only just seen it now.

Thanks for pointing out the issue with GetStrFromPtrW and the missing Subject Property. (y)
 
Upvote 0
Jaafar, please, please excuse me as I am not much of a programmer, however I was able to follow much of this excellent post. I thought that I would mention two items that I encountered when testing the demo xlsm spreadsheet on my Win 10, MS 365 64x system. First, the function GetStrFromPtrW wouldn't work, but when I switched it back to the original (commented out) code in the demo, that code worked. Second, I was unable to set the Subject property on an image file and low and behold I noticed that that specific property was missing in the PropNameToPropKey function so it did not recieve a call to the DEFINE_PROPERTYKEY function. I added one and now it seems to work perfectly. Thank you for a serious amount of effort for folks like me trying to do some VBA edititing of extended file properties.
I am missing the SUBJECT property too. Kind if you could guide me how to add that property?
 
Upvote 0
I tried to modify the attributes of a PNG file. Only the date taken attribute was set. I honestly have no idea if that's by design, but it does set the attributes when it's a JPG.

I also have no idea of where you get all of this boilerplate code to do these low level things, mind giving me a few pointers? hehe
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,246
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top