[blue]Option Explicit
Private Enum ColumnDetail
detailInfoTip = -1
detailName = 0
detailSize = 1
detailType = 2
detailModified = 3
detailAttributes = 4
detailComment = 5
detailCreated = 6
detailAccessed = 7
detailOwner = 8
detailUnknown = 9 ' I don't know what this column is for
detailAuthor = 10
detailTitle = 11
detailSubject = 12
detailCategory = 13
detailPages = 14
detailCopyright = 15
detailCompanyName = 16
detailModuleDescription = 17
detailModuleVersion = 18
detailProductName = 19
detailProductVersion = 20
detailSenderName = 21
detailRecipientName = 22
detailRecipientNumber = 23
detailCsid = 24
detailTsid = 25
detailTransmissionTime = 26
detailCallerID = 27
detailRouting = 28
detailAudioFormat = 29
detailAudioSampleRate = 30
detailAudioSampleSize = 31
detailChannels = 32
detailPlayLength = 33
detailFrameCount = 34
detailFrameRate = 35
detailVideoSampleSize = 36
detailVideoCompression = 37
End Enum
Private Function GetColumnDetail(ByVal strFilename As String, Optional iColumn As ColumnDetail = detailInfoTip)
Dim fso As FileSystemObject
Dim myShell As Shell
Dim myFolder As Folder
Dim myItem As FolderItem
Dim lp As Long
Set fso = New FileSystemObject
Set myShell = New Shell
Set myFolder = myShell.NameSpace(fso.GetParentFolderName(strFilename))
Set myItem = myFolder.Items.Item(fso.GetFileName(strFilename))
GetColumnDetail = myFolder.GetDetailsOf(myItem, iColumn)
End Function
Private Sub Command1_Click()
' demonstrates getting the title from a demo Word document file
MsgBox "Title: " & GetColumnDetail("C:\test2.doc", detailTitle)
' Further illustrates the power of this technique by getting info about a wav file
MsgBox "Tooltip: " & GetColumnDetail("C:\WINNT\Media\notify.wav")
MsgBox "Sample rate: " & GetColumnDetail("C:\WINNT\Media\notify.wav", detailAudioSampleRate)
End Sub[/blue]