Working fine here on a .ppt file:
Sub test()
MsgBox GetFileProperty("C:\ExcelFiles\", "test.ppt", , "Category")
End Sub
RBS
"Barb Reinhardt" <(E-Mail Removed)> wrote in message
news:EA4D4FFE-4E44-4D85-A33A-(E-Mail Removed)...
> I'm actually wanting to check the properties of a PowerPoint presentation.
> I'm getting an error on this line:
>
> Set objFolderItem = objFolder.ParseName(strFile)
>
> Run time error '91'
> Object variable or With block variable not set
>
> Any idea what the issue might be?
>
> Thanks,
> Barb Reinhardt
> "RB Smissaert" wrote:
>
>> You can do this with DSOFile.dll or try this function:
>>
>> 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 arrHeaders(41)
>>
>> Set objShell = CreateObject("Shell.Application")
>> Set objFolder = objShell.Namespace(vFolder)
>> Set objFolderItem = objFolder.ParseName(strFile)
>>
>> If Len(strItemName) > 0 Then
>> For i = 0 To 40
>> arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
>> If arrHeaders(i) = strItemName Then
>> lIndex = i
>> Exit For
>> End If
>> Next
>> End If
>>
>> GetFileProperty = objFolder.GetDetailsOf(objFolderItem, lIndex)
>>
>> End Function
>>
>>
>> Use it like this:
>>
>> Sub test()
>>
>> MsgBox GetFileProperty("C:\ExcelFiles\", "MyFile.xls", , "Category")
>>
>> End Sub
>>
>>
>> It works on for example text files as well.
>>
>>
>> RBS
>>
>>
>> "Barb Reinhardt" <(E-Mail Removed)> wrote in
>> message
>> news:CF38A1B0-77C2-4DA7-A38E-(E-Mail Removed)...
>> > Is it possible to do this? I am trying to get data out of a team
>> > site
>> > and
>> > I have the site mapped. We also have custom document properties for
>> > year,
>> > month, etc. I'd like to only open those workbooks that meet a
>> > specified
>> > selection. Can this be done, or can we only get the custom document
>> > properties when the workbook is opened. Right now I'm opening every
>> > workbook
>> > and looking at the properties, but I'd like to cut out the open step if
>> > possible.
>> >
>> > Thanks,
>> > Barb Reinhardt
>>
>>
|