Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Done that recently. Use the DSOFile object. In Excel-VBA you first need to create a reference to Dsofile.dll ("DSO OLE Document Properties Reader 2.1" or similar). Also check you have a reference to the Office library </p> <p>First you may want to select the file path which you want to examine</p> <pre><code>Sub MainGetProps() Dim MyPath As String MyPath = GetDirectoryDialog() If MyPath = "" Then Exit Sub GetFileProps MyPath, "*.*" End Sub </code></pre> <p>Let's have a nice Path selection window</p> <pre><code>Function GetDirectoryDialog() As String Dim MyFD As FileDialog Set MyFD = Application.FileDialog(msoFileDialogFolderPicker) With MyFD .AllowMultiSelect = False .Show If .SelectedItems.Count &lt;&gt; 0 Then GetDirectoryDialog = .SelectedItems(1) End If End With End Function </code></pre> <p>Now let's use the DSO object to read out info ... I reduced the code to the bare necessary</p> <pre><code>Private Sub GetFileProps(MyPath As String, Arg As String) Dim Idx As Integer, Jdx As Integer, MyFSO As FileSearch, MyRange As Range, MyRow As Integer Dim DSOProp As DSOFile.OleDocumentProperties Set DSOProp = New DSOFile.OleDocumentProperties Set MyRange = ActiveSheet.[A2] ' your output is nailed here and overwrites anything Set MyFSO = Application.FileSearch With MyFSO .NewSearch .LookIn = MyPath .SearchSubFolders = True ' or false as you like .Filename = Arg .FileType = msoFileTypeAllFiles If .Execute() &gt; 0 Then MsgBox .FoundFiles.Count &amp; " file(s) found." ' to see what you will get For Idx = 1 To .FoundFiles.Count DSOProp.Open .FoundFiles(Idx) ' examine the DSOProp element in debugger to find all summary property names; not all may be filled though Debug.Print .FoundFiles(Idx) Debug.Print "Title: "; DSOProp.SummaryProperties.Title Debug.Print "Subject: "; DSOProp.SummaryProperties.Subject ' etc. etc. write it into MyRange(Idx,...) whatever ' now hunt down the custom properties For Jdx = 0 To DSOProp.CustomProperties.Count - 1 Debug.Print "Custom #"; Jdx; " "; Debug.Print " Name="; DSOProp.CustomProperties(Jdx).Name; If DSOProp.CustomProperties(Jdx).Type &lt;&gt; dsoPropertyTypeUnknown Then Debug.Print " Value="; DSOProp.CustomProperties(Jdx).Value Else Debug.Print " Type=unknowwn; don't know how to print"; End If MyRow = MyRow + 1 Next Jdx DSOProp.Close Next Idx Else MsgBox "There were no files found." End If End With End Sub </code></pre> <p>and that should be it</p> <p>good luck MikeD</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload