Cannot assign shortcut to VSTA macros.

Hello! I got a curious problem with VSTA macros. I cannot assign keyboard shortcut to them. I can do it for the VBA macros and I can even run all of them via the macro manager, but that kinda defeats the purpose of writing macros.

Parents
No Data
Reply
  • You cannot add the macro that way.  To do it, you will need to create an addon solution and update either the AppUI.xslt or the UserUI.xslt.  There is an example here of how to setup the Addon that I made a while back. https://stackoverflow.com/questions/23733516/create-a-custom-control-in-corel-draw-x6-using-only-vsta/38268749?noredirect=1#comment95301472_38268749

    Once you do what is in the link and get a button working. You can put one of the 2 xslt files I mentioned above in the addon code as well.  It will look like this:

    	<xsl:template match="uiConfig/shortcutKeyTables/table[@tableID='bc175625-191c-4b95-9053-756e5eee26fe']">
    		<xsl:copy>
    			<xsl:apply-templates select="node()|@*" />
     
    			<keySequence itemRef="4fe6c05f-7abd-45bd-8b17-5efc46b46c80">
    				<key>+</key>
    			</keySequence>
    		</xsl:copy>
    	</xsl:template>


    In this example, "4fe6c05f-7abd-45bd-8b17-5efc46b46c80" is the GUID of the button I created. You will need to generate your own arbitrary GUIDs for your buttons. Also, just because you have a button does not mean you need to show it to the user. You can hide it on a new menu that is not shown.

Children