Visio Guy

Visio Discussions => Programming & Code => Topic started by: xiamen168 on August 25, 2015, 03:09:51 AM

Title: i want add my action by docmd in right menu
Post by: xiamen168 on August 25, 2015, 03:09:51 AM
i want add my action by docmd in right menu,
how to setup it to let this docmd canbe call my VBA function ?

shapesheet actions
docmd(xxx)   ->  VBA 's function myfun()

regards!
Title: Re: i want add my action by docmd in right menu
Post by: wapperdude on August 25, 2015, 05:40:58 AM
Don't think that's possible with DOCMD.  Here's a list of allowed commands:  https://msdn.microsoft.com/en-us/library/aa342178.aspx.

But, you can use RUNMACRO or CALLTHIS in the Actions section of the shapesheet.  For example, add =RUNMACRO ("ThisDocument.MyMacro") in the Action cell.  Add STH like "My Macro"  in the menu cell.

Then, when you right click the shape, click My Macro, and the macro will execute.

Info on shapesheet functions can be found here:  https://msdn.microsoft.com/en-us/library/ms427031(v=office.12).aspx

Wapperdude
Title: Re: i want add my action by docmd in right menu
Post by: xiamen168 on August 25, 2015, 06:36:48 AM
[in the Actions section of the shapesheet] i knowed,
but i want docmd :'( :'( :'( No way!

thanks!!!


Title: Re: i want add my action by docmd in right menu
Post by: xiamen168 on August 25, 2015, 06:42:14 AM
Add STH like "My Macro" in menu!!!
i got it

thanks wapperdude !!!