sundancer 发表于 2018-10-21 10:42:02

幻灯片进度条

Sub 幻灯片进度条()
颜色1 = Array(vbRed, vbBlack, vbGreen, vbYellow, vbMagenta, vbBlue, vbCyan)
颜色2 = Array(vbBlack, vbGreen, vbYellow, vbMagenta, vbBlue, vbCyan, vbRed)
n = ActivePresentation.Slides.Count
i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
SlideMaster.Label1.Caption = "当 前" & vbCrLf & IIf(i = n, "结 束", i & "/" & n)
j = i Mod 8 + 1
w = ActivePresentation.PageSetup.SlideWidth - 80
t = ActivePresentation.PageSetup.SlideHeight - 20
'For Each shp In SlideMaster.Shapes
' If shp = .Name = "进度条" Then
' If Not shp Is Nothing Then
With ActivePresentation.SlideMaster.Shapes("进度条")
.Width = w * i / n
.Fill.BackColor.RGB = 颜色1(j)
.TextFrame.TextRange.Text = Format(i / n, "0%")
.Fill.ForeColor.RGB = 颜色2(j)
End With
'Else
' With ActivePresentation.SlideMaster.Shapes.AddShape(1, 72, t - 10, w * i / n, 30)
' .Name = "进度条"
' .Fill.BackColor.RGB = 颜色1(j)
' .TextFrame.TextRange.Text = Format(i / n, "0.0%")
' .Fill.ForeColor.RGB = 颜色2(j)
' End With
'End If
'Next
End Sub

ljj_39 发表于 2018-10-21 12:58:45

我也来一个电池进度条

sailjeff 发表于 2018-10-21 13:00:49

今天发现为什么有时Sub onSlideShowPageChange()这个不执行,按一下alt+F11就能行了?

冷冰浩 发表于 2018-10-21 13:23:49

感谢楼主的分享!!!

dyslyhl 发表于 2018-10-21 13:36:11

一般般。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
页: [1]
查看完整版本: 幻灯片进度条