PPT批量插入照片,有比这更好更快的方法吗?
文件夹内有n张照片,想批量插入到ppt中,做成n张ppt页面,能否用vba或者批处理命令,我是03版。 参考:http://club.excelhome.net/forum.php?mod=viewthread&tid=1395137&extra=page%3D1&mobile=2
13楼 Sub InsertPic()
Dim i As Integer
Dim MyDialog As FileDialog, vrtSelectdeItem As Variant
On Error Resume Next
'定义一个文件选取对话框
Set MyDialog = Application.FileDialog(msoFileDialogFilePicker)
With MyDialog
.Filters.Clear'清除所有文件筛选器中的项目
.Filters.Add "所有 WORD 文件", "*.jpg;*.bmp", 1 '增加筛选器的项目为所有jpg、bmp等文件
.AllowMultiSelect = True '允许多项选择
If .Show = -1 Then
If ActivePresentation.Slides.Count < .SelectedItems.Count Then
For i = 1 To .SelectedItems.Count - ActivePresentation.Slides.Count
ActivePresentation.Slides.Add(Index:=ActivePresentation.Slides.Count, Layout:=ppLayoutText).Select
Next i
End If
i = 1
For Each vrtselecteditem In .SelectedItems'在所有选取项目中循环
ActivePresentation.Slides(i).Select
With ActiveWindow.Selection.SlideRange
.FollowMasterBackground = msoFalse
.Background.Fill.UserPicture vrtselecteditem
End With
i = i + 1
Next vrtselecteditem
End If
End With
End Sub
谢谢高手,全选确定后,转到了代码页面。 谢谢,代码很好。我重新启动ppt 2003,这个代码就没有了,需要再输入模块,请问怎么办?谢谢 做成ppa,工具栏上增加一按钮。
也可封装成ddl. 做成ppa,工具栏上增加一按钮。
也可封装成dll.
页:
[1]