代码:
With pptApp.FileSearch
.FileName = "*.JPEG"
.LookIn = "D:\Work\VB\Picture"
.Execute
End With
Dim wd As Double
Dim hi As Double
wd = pptApp.ActivePresentation.PageSetup.SlideWidth
hi = pptApp.ActivePresentation.PageSetup.SlideHeight
pptApp.ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:=pptApp.FileSearch.FoundFiles(1), LinkToFile:=False, SaveWithDocument:=True, Left:=40, Top:=115, Width:=wd * 0.9, Height:=hi * 0.7).Select
这样加载的第一张图片FileName:=pptApp.FileSearch.FoundFiles(1)就是按照文件名排序后的第一个图片。
楼上能否给出具体代码?