I'm using PowerPoint 2007, trying to press buttons via VBA. Consider the following function:
Sub ClickButton(str As String)
CommandBars.ExecuteMso str ' execute respective button action
Debug.Print CommandBars.GetPressedMso(str) ' retrieve button state after executing action
End Sub
I expected the above function to do the following:
In PowerPoint 2007, if ShapeRectangle is already selected, a call to ClickButton("ObjectsSelect") prints False, even if we ExecuteMso prior to output. Still, ExecuteMso seems to work, because after the function is executed, ObjectsSelect is pressed
in the ribbon.
Newer PowerPoint versions, or other buttons, seem to work as expected.
Is the behaviour in 2007 with ObjectsSelect documented somewhere? Or did I just encounter a bug?