Accessing Custom Doc Properties on Closed File
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" wrote in message
...
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" wrote in
message
...
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" wrote in
message
...
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" wrote in
message
...
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
|