Run PowerPoint Addin Macro (IRibbonControl & Application.Run) ?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
delart2
Posts: 1
Joined: 15 May 2021, 15:07

Run PowerPoint Addin Macro (IRibbonControl & Application.Run) ?

15 May 2021, 15:51

Hello,

I have written custom PowerPoint toolbar which is installed on my computer and loads when PPT opens.

I would like to be able to launch a macro from this .ppam addin using AutoHotKey.

In VBA, I can do it by executing the following Sub.

Code: Select all

Sub LaunchExample()
Dim Control as IRibbonControl
Application.Run("MyToolBarName.ppam!Macro1", Control)
End Sub
In my .ppam file, my macro looks like this:

Code: Select all

Sub Macro1 (Control as IRibbonControl)
'My instructions
End Sub
So Control is a mandatory argument to launch the macro.

I'm struggling to "translate" the above VBA sub to AutoHotKey - so far I have this

Code: Select all

PPTApp := ComObjActive("PowerPoint.Application")
PPTApp.Run(Run("MyToolBarName.ppam!Macro1")
Which doesn't work, since I it doesn't give Macro 1 its required IRibbonControl argument - I don't know how to create it.

Any clue on how I can pass a IRibbonControl variable to my sub in AutoHotKey ?
Or any idea on how to achieve this result otherwise ? (launch an addin macro from AutoHotKey)

Any help appreciated :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Nerafius and 116 guests