2

The following code opens Animation Pane in Power Point Application.

Application.CommandBars.FindControl(Id:=730, Type:=1).Execute

I want to open Animation Pane if Animation Pane is not already open.

1 Answer 1

4

When the Animation Pane is visible, the "Animation Pane" button on the Ribbon/Command Bar displays as toggled-on. This maps to its State property, which is an MsoButtonState enum

Name Value Description
msoButtonDown -1 Button is Down, or Toggled On
msoButtonUp 0 Button is Up, or Toggled Off
msoButtonMixed 2 Button is Down (alternate)

You can either check if the State is msoButtonUp / 0, or is not msoButtonDown / -1 before you Execute it:

If Application.CommandBars.FindControl(Id:=730, Type:=1).State=msoButtonUp Then Application.CommandBars.FindControl(Id:=730, Type:=1).Execute

' Or 

With Application.CommandBars.FindControl(Id:=730, Type:=1)
    If .State = msoButtonUp Then .Execute
End With
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.