PC Review


Reply
Thread Tools Rate Thread

Accessing Custom Doc Properties on Closed File

 
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      19th Jul 2007
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
 
Reply With Quote
 
 
 
 
RB Smissaert
Guest
Posts: n/a
 
      19th Jul 2007
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


 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      19th Jul 2007
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

>
>

 
Reply With Quote
 
RB Smissaert
Guest
Posts: n/a
 
      19th Jul 2007
Can you post the actual code you did run?
Will try it on a PP file here.

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

>>
>>


 
Reply With Quote
 
RB Smissaert
Guest
Posts: n/a
 
      19th Jul 2007
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

>>
>>


 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      19th Jul 2007
I'm trying it on a team site that's mapped to a drive. Might that be the
problem?

"RB Smissaert" wrote:

> Can you post the actual code you did run?
> Will try it on a PP file here.
>
> 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
> >>
> >>

>
>

 
Reply With Quote
 
RB Smissaert
Guest
Posts: n/a
 
      19th Jul 2007
Probably yes.
Could you post the code you run to call the function?

RBS

"Barb Reinhardt" <(E-Mail Removed)> wrote in message
news:1E0AB04C-4AB8-4853-98F6-(E-Mail Removed)...
> I'm trying it on a team site that's mapped to a drive. Might that be the
> problem?
>
> "RB Smissaert" wrote:
>
>> Can you post the actual code you did run?
>> Will try it on a PP file here.
>>
>> 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
>> >>
>> >>

>>
>>


 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      19th Jul 2007
The code gets caught up on this line in what you sent me:

Set objFolderItem = objFolder.ParseName(strFile)

where strfile = filename.ppt



"RB Smissaert" wrote:

> Probably yes.
> Could you post the code you run to call the function?
>
> RBS
>
> "Barb Reinhardt" <(E-Mail Removed)> wrote in message
> news:1E0AB04C-4AB8-4853-98F6-(E-Mail Removed)...
> > I'm trying it on a team site that's mapped to a drive. Might that be the
> > problem?
> >
> > "RB Smissaert" wrote:
> >
> >> Can you post the actual code you did run?
> >> Will try it on a PP file here.
> >>
> >> 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
> >> >>
> >> >>
> >>
> >>

>
>

 
Reply With Quote
 
RB Smissaert
Guest
Posts: n/a
 
      19th Jul 2007
Probably if you move your mouse over it you will see that objFolder is
Nothing.
What I need though is how you call the function. So, the folder and file
etc.
Have tried it here with a mapped drive and that works fine.

RBS


"Barb Reinhardt" <(E-Mail Removed)> wrote in message
news:363D5FC7-F2B2-4398-91C6-(E-Mail Removed)...
> The code gets caught up on this line in what you sent me:
>
> Set objFolderItem = objFolder.ParseName(strFile)
>
> where strfile = filename.ppt
>
>
>
> "RB Smissaert" wrote:
>
>> Probably yes.
>> Could you post the code you run to call the function?
>>
>> RBS
>>
>> "Barb Reinhardt" <(E-Mail Removed)> wrote in
>> message
>> news:1E0AB04C-4AB8-4853-98F6-(E-Mail Removed)...
>> > I'm trying it on a team site that's mapped to a drive. Might that be
>> > the
>> > problem?
>> >
>> > "RB Smissaert" wrote:
>> >
>> >> Can you post the actual code you did run?
>> >> Will try it on a PP file here.
>> >>
>> >> 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
>> >> >>
>> >> >>
>> >>
>> >>

>>
>>


 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      19th Jul 2007
Within the Function, vFolder is

S:\FolderName\

and yes, objFolder is nothing.

"RB Smissaert" wrote:

> Probably if you move your mouse over it you will see that objFolder is
> Nothing.
> What I need though is how you call the function. So, the folder and file
> etc.
> Have tried it here with a mapped drive and that works fine.
>
> RBS
>
>
> "Barb Reinhardt" <(E-Mail Removed)> wrote in message
> news:363D5FC7-F2B2-4398-91C6-(E-Mail Removed)...
> > The code gets caught up on this line in what you sent me:
> >
> > Set objFolderItem = objFolder.ParseName(strFile)
> >
> > where strfile = filename.ppt
> >
> >
> >
> > "RB Smissaert" wrote:
> >
> >> Probably yes.
> >> Could you post the code you run to call the function?
> >>
> >> RBS
> >>
> >> "Barb Reinhardt" <(E-Mail Removed)> wrote in
> >> message
> >> news:1E0AB04C-4AB8-4853-98F6-(E-Mail Removed)...
> >> > I'm trying it on a team site that's mapped to a drive. Might that be
> >> > the
> >> > problem?
> >> >
> >> > "RB Smissaert" wrote:
> >> >
> >> >> Can you post the actual code you did run?
> >> >> Will try it on a PP file here.
> >> >>
> >> >> 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
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >>
> >>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing custom properties for an adp file Joe Microsoft Access ADP SQL Server 2 30th Jan 2007 05:44 PM
Accessing/Setting Custom Properties in a Custom TreeNode Bishop Microsoft VB .NET 0 29th Sep 2005 03:12 AM
accessing custom document properties without loading file =?Utf-8?B?RGFwcGVyRGFuSEBub3NwYW0ubm9zcGFt?= Microsoft Excel Programming 2 30th Sep 2004 01:47 AM
Re: Accessing custom document properties Andy Wiggins Microsoft Excel Worksheet Functions 0 5th Sep 2003 06:44 PM
Accessing custom document properties Tim Haley Microsoft Excel Misc 0 5th Sep 2003 04:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:17 PM.