Visio Guy

Visio Discussions => Programming & Code => Topic started by: david on September 10, 2008, 08:00:38 AM

Title: what is the event for grouping shapes?
Post by: david on September 10, 2008, 08:00:38 AM
all i found was ConvertToGroupCanceled or UngroupCanceled which are not what i needed.

i want to do some actions whenever i group shapes.  anyone knows how?

thanks
David
Title: Re: what is the event for grouping shapes?
Post by: Visio Guy on September 10, 2008, 08:17:31 AM
QueryCancelGroup.

Could also probably check ShapeAdded, but that would be more work.
Title: Re: what is the event for grouping shapes?
Post by: david on September 10, 2008, 08:37:30 AM
i didn't find that event.

i found only QueryCancelUngroup.
Title: Re: what is the event for grouping shapes?
Post by: david on September 10, 2008, 08:52:17 AM
the event ShapeAdded really worked. but how can i distinguish between the event of moving a shape from the stencil to the frame and the event of grouping shapes?  they're both included in ShapeAdded.
Title: Re: what is the event for grouping shapes?
Post by: Paul Herber on September 10, 2008, 08:58:36 AM
There is a QueryCancelGroup (visEvtCodeQueryCancelSelGroup) with value &H038D and
QueryCancelConvertToGroup (visEvtCodeQueryCancelConvertToGroup) with value &H038B

http://msdn.microsoft.com/en-us/library/aa342177.aspx

Title: Re: what is the event for grouping shapes?
Post by: david on September 10, 2008, 09:46:12 AM
but i searched it in Object Browser in visio and didn't find it.

i checked in google and it's said there that QueryCancelGroup belongs to visio 2007.  i have visio 2003 maybe that is why i can't find it?
Title: Re: what is the event for grouping shapes?
Post by: Paul Herber on September 10, 2008, 09:53:30 AM
That will be the reason!


Title: Re: what is the event for grouping shapes?
Post by: david on September 10, 2008, 09:57:48 AM
so how can i do it in visio 2003?
Title: Re: what is the event for grouping shapes?
Post by: david on September 15, 2008, 07:26:26 PM
i don't understand why there's no such event (QueryCancelGroup) in visio 2003.
i really need that event and i can't use Document_ShapeAdded because its parameter is of type Shape and i need to work on Selection (QueryCancelGroup's parameter) and not Shape.

all i need is to do some actions whever i create a group.  there must be a way in visio 2003.

anyone has any suggestion what to do? (except for converting to visio 2007 - this is not an option).