Does any people know sample about double click on visio shape by V

Q

Quang Vu

Hi,
Now I am new learner about VSTO - Visio. I want to open new form when I
double click on shape. but I don't know method to do it. Please help me.
Thank you.

Best Regards,
 
J

JuneTheSecond

If the VBa macro to open OpenUserForm is prepared,
put a formula in EventDblClick cell as =RUNMACRO("OpenUserForm").
 
D

David Parker

If you are using VSTO or a COM addin then you can use the QueueMarkerEvent
in one of two ways in the ShapeSheet EventDblClick cell:
=RUNADDONWARGS("QueueMarkerEvent","/solution=MyAddin /cmd=x")
or
=QUEUEMARKEREVENT("/solution=MyAddin /cmd=x")

The string "/solution=MyAddin /cmd=x" is merely a convention (it could be
anything), but using this convention makes it easier becaus the Visio SDK
contains sample code to parseMarkerEvent.

The difference between the RUNADDONWARGS and QUEUEMARKEREVENT functions is
that RUNNADDOWARGS also passes thru other parameters in a similar manner,
such as the document, page and shape, but you can easily work these out from
the ActiveWindow.Selection if the shape double click started it.
 
Q

Quang Vu

Dear Mr. David Parker,
I thank you for support. But I still don't understand it.
Ex: I want to create a VSTO Add-In that create a shape on sheet page and
when I double click on it that open a new form (ex: my form is NewForm).
May you explain more details for me ? Thank you very much.

Best Regards,

David Parker said:
If you are using VSTO or a COM addin then you can use the QueueMarkerEvent
in one of two ways in the ShapeSheet EventDblClick cell:
=RUNADDONWARGS("QueueMarkerEvent","/solution=MyAddin /cmd=x")
or
=QUEUEMARKEREVENT("/solution=MyAddin /cmd=x")

The string "/solution=MyAddin /cmd=x" is merely a convention (it could be
anything), but using this convention makes it easier becaus the Visio SDK
contains sample code to parseMarkerEvent.

The difference between the RUNADDONWARGS and QUEUEMARKEREVENT functions is
that RUNNADDOWARGS also passes thru other parameters in a similar manner,
such as the document, page and shape, but you can easily work these out from
the ActiveWindow.Selection if the shape double click started it.
 
D

David Parker

If you examine the Treeview sample in the Visio SDK, the EventSink class
contains a sub handleMarkerEvent.
You could follow this example and create your own select case to open your
form when a shape is double-clicked, if that shape has one of the ShapeSheet
functions I described previously.

If you are saying that you don't know how to write addins, then download the
Visio 2007 Solution Developement Workshop
http://www.microsoft.com/downloads/...1e-581e-4029-9839-8f45de10b4c2&DisplayLang=en


--
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com
Quang Vu said:
Dear Mr. David Parker,
I thank you for support. But I still don't understand it.
Ex: I want to create a VSTO Add-In that create a shape on sheet page and
when I double click on it that open a new form (ex: my form is NewForm).
May you explain more details for me ? Thank you very much.

Best Regards,
 
Q

Quang Vu

Dear Mr. David Parker,

By you I am converting WBSTreeView into VSTO but I have a bug as below:
- Value of "context" variant in WBSTreeView is correct but in VSTO it is
nothing.
so the program terminate and I can not handle any events on Visio. Please
help me.
Thank you for attention.

Best Regards,

Quang Vu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top