|
楼主 |
发表于 2016-9-9 20:18
|
显示全部楼层
原代码如下:
Sub 插入视频()
h = ActivePresentation.PageSetup.SlideHeight / 2
w = ActivePresentation.PageSetup.SlideWidth / 2
l = w / 4 + 10
t = h / 2
pth1 = "H:\Ofenused\视频\电影\"
pth2 = "H:\Ofenused\视频\歌曲\"
pth3 = "H:\Ofenused\视频\新歌\"
pth4 = "H:\Ofenused\视频\杂合\"
pth5 = "H:\Ofenused\视频\郑云\"
arr = Array(pth1, pth2, pth3, pth4, pth5)
zd = UBound(arr)
ipth = arr(Int(Rnd * zd))
Set d = CreateObject("scripting.dictionary")
mn = Dir(ipth & "*.*")
Do While mn <> ""
d(ipth & mn) = ""
mn = Dir
Loop
k = d.keys
sj = Rnd * UBound(k)
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
With shps.AddMediaObject2(FileName:=k(sj), Left:=l, Top:=t, Width:=w, Height:=h)
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
End Sub |
|