keronmom.blogg.se

Windows 10 get custom property out of file details
Windows 10 get custom property out of file details






The reason I said 'from whom exactly' was that I've never even heard of GetDetailsOf function before today. Unfortunately for a csv file it didn't give the total number of records / rows but I can do that in other ways.Īs an example, this is the output for an image file:ġ0 - Owner: S-1-5-21-2930312881-120557777-2257318752-3500ġ84 - Folder path: G:\Programs\MendipDataSystems\CommonFiles\SDA\Imagesġ85 - Folder: Images (G:\Programs\MendipDataSystems\CommonFiles\SDA)ġ87 - Path: G:\Programs\MendipDataSystems\CommonFiles\SDA\Images\AccessErrorCodes.gifĠ - Name: Collect Data & Send Emails-DarwinCabr-20170531-2.xlsmĢ - Item type: Microsoft Excel Macro-Enabled WorksheetĢ1 - Title: Collect Data & Send Emails 3050 Chevron Central America Darwin - Categories: 68 60 2 6 0 0 0 0 0 0 0.514 0 0 60 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0Ģ4 - Comments: Send Task: 12:38:56 AM Read: 21:34:02ġ44 - Content created: ?1/?11/?2008 ?5:30 PMġ46 - Date last saved: ?6/?3/?2017 ?12:06 PMġ57 - Filename: Collect Data & Send Emails-DarwinCabr-20170531-2.xlsmġ82 - Folder path: C:\Users\EXPERTS-PC\Downloadsġ83 - Folder: Downloads (C:\Users\EXPERTS-PC)ġ85 - Path: C:\Users\EXPERTS-PC\Downloads\Collect Data & Send Emails-DarwinCabr-20170531-2.xlsmġ87 - Type: Microsoft Excel Macro-Enabled Worksheet Its extremely fast & potentially very useful in that it gets lots of properties at once that previously I had to obtain in a variety of ways.įor example, file size / date created / modified / image dimensions etc etc If Nz(objFolder.GetDetailsOf(objFolderItem, I), "") "" Thenĭebug.Print I & " - " & objFolder.GetDetailsOf(objFolder.Items, I) & ": " & _ 'list attributes available in this folder: Set objFolderItem = objFolder.ParseName(strFileName)ĪName = objFolder.GetDetailsOf(objFolder.Items, I)ĪValue = objFolder.GetDetailsOf(objFolderItem, I) Set objFolder = objShell.NameSpace(strPath) StrPath = Left(strFilePath, Len(strFilePath) - Len(strFileName) - 1) I = InStr(1, strFileName, "\", vbBinar圜ompare) ' Const strFilePath = "G:\Programs\MendipDataSystems\CommonFiles\SDA\Documentation\AnalyseSessionReportGrades.pdf"Ĭonst strFilePath = "D:\Colin\My Documents\My Music\Leonard Cohen\You Want It Darker\04 Leaving The Table.mp3"ĭim strPath As String, strFileName As Stringĭim tComments As String, tCategory As String, tTitle As Stringĭo Until I = 0 'find the last "\" and get the filename

windows 10 get custom property out of file details

' Const strFilePath = "G:\Programs\MendipDataSystems\CommonFiles\SDA\Images\AccessErrorCodes.gif" ' Const strFilePath = "G:\Programs\MendipDataSystems\CommonFiles\SDA\Icons\SDA_DEMO.ico" 'This requires the reference: Microsoft Shell Controls and Automation 'or, return specific property: If props.Exists("Category") Then Debug.Print props("Category")Įnd SubAttribute Names come from the folder.įull description of GetDetailsOf : (v=vs.85).aspx If props(key) "" Then Debug.Print key & ": " & props(key) Now list properties that have valuesįor Each key In props.Keys 'enumerate dictionary

windows 10 get custom property out of file details

Props.Add objFolder.GetDetailsOf(objFolder.Items, i), objFolder.GetDetailsOf(objFolderItem, i)

windows 10 get custom property out of file details

Set props = CreateObject("Scripting.Dictionary") 'create dictionary objectįor i = 0 To 286 'put properties in dictionary object for eacy retrieval later Set objFolderItem = objFolder.ParseName(strFile) 'create file object Set objFolder = objShell.NameSpace(strPath) 'create folder object StrPath = Left(strFilePath, Len(strFilePath) - Len(strFile) - 1) 'extract path

windows 10 get custom property out of file details

StrFile = Mid(strFilePath, InStrRev(strFilePath, "\") + 1) 'extract filename 'Requires reference: "Microsoft Shell Controls and Automation" (shell332.dll)Ĭonst strFilePath = "c:\MP3's\Beastie Boys - Intergalactic.mp3"ĭim objShell As Shell, objFolder As Folder, objFolderItem As FolderItemĭim props As Object, i As Long, strPath As String, strFile As String '(May 2018: updated to improve efficiency)








Windows 10 get custom property out of file details