0

I have a custom plugin that was made for powerpoint and has a functionality to export the current slide as HTML5. It doesn't support exporting the entire PPT so basically I would have to go slide by slide and export.

My question is, can I write something in VB that can execute a menu command, finish, next slide, execute menu command etc?

I don't even know if VB would be the correct language to use. I've never written anything in it.

1 Answer 1

2

VBA might be simpler since it's built into PowerPoint.

If you know the name of the command bar and the control on the command bar that you want to launch:

Sub LaunchTheCommand()
    Dim oCmdbar As CommandBar
    Set oCmdbar = Application.CommandBars("CommandBarName")
    oCmdbar.Controls("ControlName").Execute
End Sub

View | Toolbars will show you the names of your toolbars.

This could help you work out the right name for the individual controls:

Sub ShowTheControlNames()
    Dim oCmdbar As CommandBar
    Dim oCtl As CommandBarControl
    ' for example, let's look at the Standard toolbar:
    Set oCmdbar = Application.CommandBars("Standard")
    For Each oCtl In oCmdbar.Controls
        Debug.Print oCtl.Caption
    Next
End Sub

Note that your code won't work on non-English versions of PowerPoint ... the menu names are different.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for you reply. This is a good starting point I believe. What program do I use for this? MS Visual Basic? Once I am in that program, how do I execute the command? Sorry for my ignorance lol
As I mentioned, you can use VBA ... it's built into PowerPoint. I maintain a PowerPoint FAQ site that has more info on using VBA in PowerPoint. Have a look here for starters: How do I use VBA code in PowerPoint pptfaq.com/FAQ00033_How_do_I_use_VBA_code_in_PowerPoint.htm

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.