开发者

Get Font Size List in Powerpoint VBA

This code prints out every entry in the Font Size list combo box in Excel 2007 :

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

However, when I run the same code in Powerpoint 2007 the List is Empty? How can I intialize the Font Size combo box in Powerpoint VBA? I have checked both Font Size properties 'Visible' and 'Enabled', and they are both set to True.

Thanks very much

Joe


I've tried your code on both Excel and PowerPoint 2007.

On PowerPoint, FontList and FontSize are unselectable (dark grey) if no text bloc (or drawing) is selected. That could explain why the ListCount is still 0 when debugging.

That could also explain why it does work on PPT 2003 because you do not have the ribbon and maybe FontSize and FontList are already selected.

Unfortunately, even while selecting a bloc text, i did not manage to have a ListCount > 0. I'd have to look at it further.

Max

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜