Excel VBA with power point?

M

Malcom Jazz

I have bunch if power point files in a folder C:\123
I want to list each slide in those powerpoint files in the
excel sheet alongwith full path and filename. Is it
possible?

Regards,
Malcom
 
B

Bob Phillips

Malcolm,

Here is some code to do it


Sub FileListing()
Dim i As Long
Dim oFolder As Object
Dim oFldr As Object
Dim oFile As Object
Dim oFiles As Object
Dim sOld As String

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("C:\myTest")

a = 2
For Each oFldr In oFolder.subFolders
Set oFiles = oFolder.Files
For Each oFile In oFiles
If oFile.Type = "Microsoft Powerpoint Presentation" Then
sOld = oFile.Name
Range("A" & a) = sOld
a = a + 1
End If
Next oFile
Next oFldr

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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