找回密码
 立即注册
搜索

怪哉:插入的视频不能自动播放

2
回复
534
查看
[复制链接]

4

主题

13

帖子

44

幻币

一流武者

Rank: 3Rank: 3

积分
237
QQ
2017-2-20 14:22:01 显示全部楼层 |阅读模式
我在slidemaster中设置一个切换按钮,控制在幻灯片放映下将当前路径的视频插入到当前放映幻灯片中,并要求其自动播放,为什不能实现?大侠就我。
代码如下:
Private Sub CommandButton1_Click()
On Error Resume Next
Randomize
x = Int(8 * Rnd + 1)
With Excel.Application.WorksheetFunction
bs = .Choose(x, &H0, &HFF0000, &H46170B, &H542E08, &HE22B8A, &H212429, &HE16941, &HF5E38, FF6EC7)
qs = .Choose(x, &HD7EBFA, &HFF, &HFF901E, &HD4FF7F, &HFC7C, &HFF00FF, &HFF7F, &HFFFF00, E6E8FA)
zt = .Choose(x, "华文楷体", "黑体", "方正魏碑简体", "方正启体简体", "全新硬笔楷书简", "华文中宋", "汉鼎简特粗黑", "华文隶书", "华文行楷")
End With
With Me.CommandButton1
If .Caption = "插入视频并自动播放" Then
.Caption = "删除本视频"
.BackColor = bs
.ForeColor = qs
.Font.Name = zt
.Font.Size = 16
.Font.Italic = True
Call 插入视频
Exit Sub
End If
If .Caption = "删除本视频" Then
.Caption = "插入视频并自动播放"
.BackColor = bs
.ForeColor = qs
.Font.Name = zt
.Font.Size = 18
.Font.Italic = False
Call 删除视频
Exit Sub
End If
End With
End Sub
Sub 插入视频()
h = ActivePresentation.PageSetup.SlideHeight * 2 / 3
w = ActivePresentation.PageSetup.SlideWidth * 2 / 3
l = w / 8
t = h / 8
ipth = ActivePresentation.Path
filnm = ipth & "蛇吞人.wmv"
For Each shp In ActivePresentation.SlideShowWindow.View.Slide.Shapes
If shp.Type = 16 Then shp.Delete
Next
Set shp = Nothing
Set shps = ActivePresentation.SlideShowWindow.View.Slide.Shapes
Set sp = shps.AddMediaObject2(FileName:=filnm, Left:=l, Top:=t, Width:=w, Height:=h)
With sp
Randomize
.AutoShapeType = Choose(Int(Rnd * 9) + 1, 6, 9, 10, 132, 13, 28, 94, 95, 96)
With .ThreeD
If sj Mod 2 = 1 Then
.SetThreeDFormat msoThreeD & (Int(Rnd * 20) + 1)
Else
.BevelTopType = 3
.BevelTopDepth = 10
.BevelBottomType = 3
.BevelBottomDepth = 6
End If
End With
End With
With sp.AnimationSettings.PlaySettings
.PlayOnEntry = True
.PauseAnimation = False
End With
End Sub
Sub 删除视频()
For Each shp In ActivePresentation.SlideShowWindow.View.Slide.Shapes
If shp.Type = 16 Then shp.Delete
Next
End Sub
附件如下见下一楼:

PPT学习论坛
回复

使用道具 举报

1

主题

8

帖子

32

幻币

江湖少侠

Rank: 2

积分
192
QQ
2017-2-20 16:26:11 显示全部楼层

附件如下:

插入视频不能自动播放.zip (1005.83 KB, 下载次数: 99)
PPT学习论坛
回复 支持 反对

使用道具 举报

5

主题

8

帖子

102

幻币

一流武者

Rank: 3Rank: 3

积分
307
QQ
2017-2-20 17:37:59 显示全部楼层
再次求救,愿高人搭手救援。
PPT学习论坛
回复 支持 反对

使用道具 举报

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