Sub ImportABunch()
Dim strTemp As String
Dim strPath As String
Dim strFileSpec As String
Dim oSld As Slide
Dim oPic As Shape
' Edit these to suit:
strPath = "C:\Documents and Settings\me\Desktop\screens\Modul 1"
strFileSpec = "*.jpg"
strTemp = Dir(strPath & strFileSpec)
Do While strTemp <> ""
Set oSld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1, ppLayoutBlank)
Set oPic = oSld.Shapes.AddPicture(FileName:=strPath & strTemp, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=0, _
Top:=0, _
Width:=100, _
Height:=100)
' Reset it to its "real" size
With oPic
.ScaleHeight 1, msoTrue
.ScaleWidth 1, msoTrue
End With
' Get the next file that meets the spec and go round again
strTemp = Dir
Loop
End Sub
|