try lookingup in VBA help for filesystemobject, kind of off topic but here is a bit of code i use to go through folders to add pictures to a powerpoint presentation from files in a folder using the filesystem object, but you can also use the object to search as well
dont forget to reference it
Sub CrtPresentation()
Dim FsO As FileSystemObject
Dim Fld As Folder
Dim fiL As File
Dim StrFil As String
Dim StrTit As String
Dim AddorNew As Boolean
Set FsO = New FileSystemObject
Set Fld = FsO.GetFolder("C:\temp\storyboards"
AddorNew = True
For Each fiL In Fld.Files
StrFil = fiL.Path
StrTit = "SC: " & Left(fiL.Name, 2) & " " & "Shot ##" & Mid(fiL.Name, 3, 2)
If AddorNew = True Then
'----------------------insert slide
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=2, Layout:=ppLayoutBlank).SlideIndex
'-----------------------Insert picture
ActiveWindow.Selection.SlideRange.Shapes.AddPicture(StrFil, msoFalse, msoTrue, Left:=106, Top:=72, Width:=350, Height:=220).Select
'-----------------------Insert Text----------------------------
ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(msoTextOrientationHorizontal, 106#, 30, 350#, 36#).Select
ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap = msoTrue
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = StrTit
With .Font
.Name = "Times New Roman"
.Size = 24
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End With
AddorNew = False
Else
'-----------------------Insert Picture
ActiveWindow.Selection.SlideRange.Shapes.AddPicture(StrFil, msoFalse, msoTrue, Left:=106, Top:=400, Width:=350, Height:=220).Select
'-----------------------Insert Text----------------------------
ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(msoTextOrientationHorizontal, 106#, 370, 350#, 36#).Select
ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap = msoTrue
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = StrTit
With .Font
.Name = "Times New Roman"
.Size = 24
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End With
AddorNew = True
End If
Next
End Sub
Filmmaker, gentlemen and proffesional drinker