Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: urs63 on November 26, 2015, 09:16:57 AM

Title: Shape should create new page if used
Post by: urs63 on November 26, 2015, 09:16:57 AM
Does anybody know if a shape can be configured by its shapesheet (and not by VBA) in the way that it creates a new page when it will be used (dragged from its stencil)? If yes, what command/event I have to use?
Thanks
Title: Re: Shape should create new page if used
Post by: Surrogate on November 26, 2015, 09:32:46 AM
i am not sure that it possible via shapesheet  ::)
Title: Re: Shape should create new page if used
Post by: urs63 on November 26, 2015, 09:42:24 AM
Hi

I might to remember that there were some shapes (backgrounds, I think) in a stencil in a earlier version of VISIO (2007?). If you used them they created a new page (as a background page)...
Title: Re: Shape should create new page if used
Post by: Paul Herber on November 26, 2015, 11:17:01 AM
Those shapes have the following formula in the EventDrop cell:
=RUNADDON("Make Background")+SETF("EventDrop",0)
This calls the Make Background addon. There is no equivalent to make a page.
Another way would have been to use DoCMD() to access the many commands within Visio's automation, however, the command to add a page (visCmdInsertPageTab = 2202) doesn't work from the shapesheet.
It should be possible to create a small add on to create a new page, and then call this when the shape is dropped.

Title: Re: Shape should create new page if used
Post by: Yacine on November 26, 2015, 07:40:35 PM
Just tested this code : RUNADDONWARGS("OPC","/CMD=1") ,
copied from an off-page-reference shape and pasted it in the double-click event of a virgin shape. It does create a new page.
Title: Re: Shape should create new page if used
Post by: urs63 on November 27, 2015, 07:49:51 AM
Thank you all especially Paul and Yacine! Have a good winter - here in France we already have snow...
Regards Urs
Title: Re: Shape should create new page if used
Post by: Yacine on November 27, 2015, 08:49:57 AM
Et maintenant tu retournes dans ta caverne hiberner? Bon hiver à toi aussi ;) .

PS: the enclosed image shows snow made in Visio.
Title: Re: Shape should create new page if used
Post by: Paul Herber on November 27, 2015, 04:33:58 PM
The huskies haven't been there yet!  :o