Can't find files on Sharepoint site using FilesSearch object

J

Jack

I've got a PowerPoint macro that searches a Draft sub-directory and inserts
the slides from PowerPoint presentations in this folder into my current
presentation. It works great on my local drive or on a network drive.

When I use this from a Sharepoint site Document Library, FileSearch.Execute
always returns zero found files.

In debugging I did find that it would correctly change the "\Drafts" to
"/Drafts" when it concatenated to the current path and assigned it to
FileSearch.LookIn.

Is there a FileSearch workaround for Sharepoint sites?

Here is the macro code:
'Look for lesson slides in current directory
With Application.FileSearch

'Look only for PowerPoint presentations
.FileType = msoFileTypePowerPointPresentations

'Set the directory of the draft slides
.LookIn = ActivePresentation.Path & "\Draft"

'Search for section slide files
.Execute
For File = 1 To .FoundFiles.Count
'Add found slides to the end of this presentation
ActivePresentation.Slides.InsertFromFile _
FileName:=.FoundFiles(File), _
Index:=ActivePresentation.Slides.Count
Next File

End With 'FileSearch

'Save changes
ActivePresentation.Save
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top