Sub AddImagesToSlides()
Dim ppApp As PowerPoint.Application
Set ppApp = New PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Set ppPres = ppApp.Presentations.Add
Dim folderPath As String
folderPath = "C:\wenjianjia" '注意双引号内输入图片所在文件夹位置
Dim extensions() As Variant
extensions = Array("jpg", "jpeg", "png", "gif")
Dim i As Integer
For i = LBound(extensions) To UBound(extensions)
Dim fileName As String
fileName = Dir(folderPath & "\*." & extensions(i))
While fileName <> ""
Dim ppSlide As PowerPoint.Slide
Set ppSlide = ppPres.Slides.Add(ppPres.Slides.Count + 1, ppLayoutBlank)
ppSlide.Shapes.AddPicture folderPath & "\" & fileName, msoFalse, msoTrue, 0, 0
fileName = Dir()
Wend
Next i
ppApp.Visible = True
End Sub