simoncpage
Programmer
I have the following function that works fine for activeworkbooks how do I display the properties of a file that isn't open but one which I have selected? (or typed in the path of in a txtbox?)
Thanks
Simon
-------------------
Function ListBuiltInProps(lstListBox As MSForms.ListBox, _
strFileName As String)
Dim prpDocProp As DocumentProperty
Dim colPropsColl As DocumentProperties
Select Case mstrAppName
Case "Microsoft Excel"
Set colPropsColl = Excel.Application.ActiveWorkbook.BuiltinDocumentProperties
'Case "Microsoft Word"
' Set colPropsColl = Word.Application.ActiveDocument.BuiltinDocumentProperties
'Case "Microsoft PowerPoint"
' Set colPropsColl = PowerPoint.Application.ActivePresentation.BuiltinDocumentProperties
Case Else
End Select
On Error Resume Next
lstListBox.Clear
For Each prpDocProp In colPropsColl
lstListBox.AddItem prpDocProp.Name & " = " & prpDocProp.Value
Next prpDocProp
End Function
Thanks
Simon
-------------------
Function ListBuiltInProps(lstListBox As MSForms.ListBox, _
strFileName As String)
Dim prpDocProp As DocumentProperty
Dim colPropsColl As DocumentProperties
Select Case mstrAppName
Case "Microsoft Excel"
Set colPropsColl = Excel.Application.ActiveWorkbook.BuiltinDocumentProperties
'Case "Microsoft Word"
' Set colPropsColl = Word.Application.ActiveDocument.BuiltinDocumentProperties
'Case "Microsoft PowerPoint"
' Set colPropsColl = PowerPoint.Application.ActivePresentation.BuiltinDocumentProperties
Case Else
End Select
On Error Resume Next
lstListBox.Clear
For Each prpDocProp In colPropsColl
lstListBox.AddItem prpDocProp.Name & " = " & prpDocProp.Value
Next prpDocProp
End Function