Finding Custom Document Properties without opening Presentation

B

Barb Reinhardt

RB Smissaert in the Excel Programming newsgroup helped me to get this
function to find the custom document properties.

Function GetFileProperty(vFolder As Variant, _
strFile As String, _
Optional lIndex As Long, _
Optional strItemName As String) As String

Dim i As Long
Dim objShell As Object
Dim objFolder As Object
Dim objfolderitem As Object
Dim objItem As Object
Dim arrHeaders(41)


Debug.Print vFolder, strFile, strItemName

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(vFolder)

Set objfolderitem = objFolder.ParseName(strFile)


If Len(strItemName) > 0 Then
For i = 0 To objFolder.Items.Count
myHeader = objFolder.GetDetailsOf(objFolder, i)
Debug.Print i, myHeader
If myHeader = strItemName Then
lIndex = i
Exit For
End If
Next
End If


GetFileProperty = objFolder.GetDetailsOf(objfolderitem, lIndex)
Set objShell = Nothing

End Function

Unfortunately, the "properties" that it's finding are as follows:

0 Name
1 Size
2 Type
3 Date Modified
4 Date Created
5 Date Accessed
6 Attributes
7 Status
8 Owner
9 Author
10 Title
11 Subject
12 Category
13 Pages
14 Comments
15 Copyright
16 Artist
17 Album Title
18 Year
19 Track Number
20 Genre
21 Duration
22 Bit Rate
23 Protected
24 Camera Model
25 Date Picture Taken
26 Dimensions
27
28
29 Episode Name
30 Program Description
31
32 Audio sample size
33 Audio sample rate
34 Channels
35 Company
36 Description
37 File Version
38 Product Name
39 Product Version
40 Keywords

And these aren't custom properties for my presentation. Can someone help
me modify this code so that it gets me what I want?

Thanks,
Barb Reinhardt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top