此代码打印出来的字体大小列表组合框的每个条目在Excel 2007中:获取字体大小列表在Powerpoint中VBA
Sub FontSizeList()
Dim combo As CommandBarComboBox
Dim i As Integer
Dim j As Integer
For i = 1 To Application.CommandBars("Formatting").Controls.Count
If Application.CommandBars("Formatting").Controls(i).Caption = "&Font Size:" Then
Set ctl = Application.CommandBars("Formatting").Controls(i)
For j = 1 To ctl.ListCount
Debug.Print ctl.List(j)
Next j
End If
Next i
End Sub
然而,当我在2007年简报运行相同的代码列表是空的?如何初始化Powerpoint VBA中的字体大小组合框?我检查了字体大小属性“可见”和“启用”,它们都设置为True。
非常感谢
乔
你没有使用Option Explicit吗?如果没有,那么你肯定会后悔有一天...... – 2011-06-10 15:20:20
刚刚在PowerPoint 2003中运行它,在那里工作正常... – 2011-06-10 15:22:23
谢谢,是的,我使用'Option Explicit'。我正在使用Powerpoint 2007 – 2011-06-13 09:09:26