找回密码
 立即注册
搜索

求助PPT VBA 无法将图片导入幻灯片中,请帮忙看看,万分感谢,代码如下

1
回复
629
查看
[复制链接]

5

主题

11

帖子

33

幻币

一流武者

Rank: 3Rank: 3

积分
203
QQ
2017-12-10 16:50:01 显示全部楼层 |阅读模式
Dim found As Boolean, n As Byte, i As Byte, adre$, tpadr$


On Error Resume Next
adre = InputBox("请输入图片存放的路径", "图片地址")
tpadr = Dir(adre & "*.jpg")
Do


' For n = 1 To 3
ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=1, Layout:=ppLayoutTitle).SlideIndex
Set tpadrs = ActiveWindow.View.Slide.Open(tpadr)
' Do
' found = False
' For Each Sld In ActivePresentation.Slides
' For Each shp In Sld.Shapes
' If shp.HasTextFrame Then
' If shp.Type  1 Then
' If Not shp.TextFrame.HasText Then
' ActiveWindow.View.GotoSlide Index:=shp.Parent.SlideIndex
' shp.Select
' shp.Delete
' found = True
' End If
' End If
' End If
' Next shp
' Next Sld
' Loop While found = True

ActiveWindow.Selection.SlideRange.Shapes.AddPicture(tpadr, LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=20, Top:=20, Width:=500, Height:=500).Select

' Next
tpadr = Dir
Loop Until Len(tpadr) = 0
End Sub
PPT学习论坛
回复

使用道具 举报

0

主题

34

帖子

42

幻币

一流武者

Rank: 3Rank: 3

积分
305
QQ
2018-1-12 10:10:02 显示全部楼层
PPT学习论坛,顶一下。
PPT学习论坛
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册