Code: Select all
Sub FolderToSlideShow()
Dim pres As Presentation
Set pres = ActivePresentation
''' Remove any existing slides
While pres.Slides.Count > 0
pres.Slides(1).Delete
Wend
Dim strFolder As String
''' Folder assumed same as presentation
strFolder = pres.Path & "\"
Dim strImage As String
strImage = Dir(strFolder)
While Len(strImage) > 0
''' BitMaps or Jpeg files only
If (UCase(Right(strImage, 4)) = ".BMP") Or (UCase(Right(strImage, 4)) = ".JPG") Then
Dim sld As Slide
Set sld = pres.Slides.Add(pres.Slides.Count + 1, ppLayoutBlank)
sld.Select
On Error Resume Next
ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:=strFolder & strImage, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=10, _
Top:=10).Select
Else
End If
strImage = Dir ' Get next file
Wend
''' Set timings to ONE SECOND interval
With ActivePresentation.Slides.Range.SlideShowTransition
.EntryEffect = ppEffectNone
.AdvanceOnClick = msoFalse
.AdvanceOnTime = msoTrue
.AdvanceTime = 1
.SoundEffect.Type = ppSoundNone
End With
End Sub