【发布时间】:2019-02-15 06:00:05
【问题描述】:
我正在尝试检查 PowerPoint 幻灯片中的红色字体。我想将包含红色字体的幻灯片编号存储在数组中并显示在单个对话框中。目前它在一个对话框中显示一个幻灯片编号。
我当前的代码如下所示。谁能告诉我如何将它存储为数组并显示它?
Private Sub CommandButton1_Click()
Dim sld As Slide
Dim shp As Shape
Dim x As Byte
With ActivePresentation
z = .Slides(.Slides.Count).SlideNumber
MsgBox z, vbDefaultButton1, "Total Slides"
End With
Dim myarray() As Integer
ReDim myarray(0 To 2)
For i = 2 To z
Set sld = ActivePresentation.Slides(i)
For Each shp In sld.Shapes
If shp.TextFrame.TextRange.Font.Color.RGB = RGB(255, 0, 0) Then
MsgBox i, vbDefaultButton2, "Slide with RED font"
End If
Next shp
Next
End Sub
【问题讨论】:
标签: arrays vba powerpoint