My goal is to present my users a method of previewing the details of files stored on Sharepoint from within a VBA userform in excel. So far I am able to retrieve a list of files using Scripting.FileSystemObject.
I'm aware I could use ContentTypeProperties to access the information I want but this appears to be dependent on opening each file.
Is there some other method I could use which would allow me to access the metadata without having to open each file?
I'm not an avid user of Sharepoint so please excuse my use of terminology.
I'm walking in to uncharted territory in respect to my own understanding here so any help or pointers to further reading would be much appreciated.
Thank you!
edit: Existing code relying on Scripting.FileSystemObject to retrieve filename only.
Private Sub UserForm_Activate()
Dim spURL As String
Dim oFile As Object, oFSO As Object, oFldr As Object, oFiles As Object, oDSO As Object
Dim ext As String, title As String
spURL = **sharepoint url**
Set oFSO = CreateObject("Scripting.Filesystemobject")
Set oFldr = oFSO.getfolder(spURL)
Set oFiles = oFldr.Files
For Each oFile In oFiles
If InStr(1, ext, "xls") Then
Me.cboFiles.AddItem oFile.Name
End If
Next
Set oFSO = Nothing
Set oFldr = Nothing
Set oFiles = Nothing
End Sub
Now lets say I wanted to get document type, which is a custom field in the document properties when the files are checked in to sharepoint, I'm aware I could do something like:
set wb = workbooks.open(spURL & oFile.Name)
debug.print wb.ContentTypeProperties.Item(x).Value
(Where Item(x) is relative to the field I need to pull information from) However, what I'm looking to determine is if there is an alternative method which doesn't require the workbook to be open.