Run PowerPoint Addin Macro (IRibbonControl & Application.Run) ?
Posted: 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.
In my .ppam file, my macro looks like this:
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
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
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
Code: Select all
Sub Macro1 (Control as IRibbonControl)
'My instructions
End Sub
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")
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