Visio Guy

Visio Discussions => Programming & Code => Topic started by: davidgon on May 05, 2017, 10:34:28 AM

Title: How to call a macro stored in a stencil using xml code
Post by: davidgon on May 05, 2017, 10:34:28 AM
Hello!

I have created a new tab in the ribbon using xml code. Now, I have the onAction of the buttons refered to macros in the main document. I want to change this and refer the onAction="mymacro.mymacro" to a macro stored in a stencil ("mystencil").

I have tried the easy way, onAction="mystencil.mymacro.mymacro", but it does not work.

Any idea?

Thanks!  ;D
Title: Re: How to call a macro stored in a stencil using xml code
Post by: Yacine on May 05, 2017, 11:17:39 AM
A silly idea: you could leave a generic macro in the document. The macro would then call the actual macro stored in stencil by means of "callbyname".

The must be a more elegant why out there.
Title: Re: How to call a macro stored in a stencil using xml code
Post by: metuemre on May 05, 2017, 12:58:06 PM
The best way is to store custom ribbon code and all other macros in stencil as well. Then you can easily call your macro with onAction callback function
Title: Re: How to call a macro stored in a stencil using xml code
Post by: Yacine on May 05, 2017, 03:51:07 PM
That's what Dividgon is trying to do.