Excel VBA with power point?

  • Thread starter Thread starter Malcom Jazz
  • Start date Start date
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
 
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)
 
Back
Top