Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: novski on April 22, 2014, 08:38:13 AM

Title: Connector End point reads text at hooked-up shape?
Post by: novski on April 22, 2014, 08:38:13 AM
Hi
Coming to the next step of my connector i wold like it to read the text of the shape that is connected to the end point of my connector line.
Is that possible?

:o
novski
Title: Re: Connector End point reads text at hooked-up shape?
Post by: Jumpy on April 22, 2014, 12:20:23 PM
Now you have to use at least VBA event handling. You have to capture the "Shape connected" event, analyse the shapes that are connected and write the text to some user defined cell or textbox of your connector.

http://msdn.microsoft.com/de-de/library/office/ff768510%28v=office.15%29.aspx
Title: Re: Connector End point reads text at hooked-up shape?
Post by: novski on April 22, 2014, 12:32:40 PM
uuuuhhh. 
i always wanted to avoid this situation.
Is there no way to get visio connectors, to spit out where they are hooked up to?

The point is. I have never programmed jet.
Title: Re: Connector End point reads text at hooked-up shape?
Post by: aledlund on April 22, 2014, 12:58:13 PM
the short answer is that it has to be accomplished with code.
al
Title: Re: Connector End point reads text at hooked-up shape?
Post by: novski on April 23, 2014, 05:58:32 AM
Ok. Thanks for the clear answer. I will try that and come back to this in a few days.
Best Regards
Novski
Title: Re: Connector End point reads text at hooked-up shape?
Post by: Yacine on April 23, 2014, 06:12:46 AM
Hi Novski,
we've posted some days ago a chunk of code that can more or less be adapted universally.
http://visguy.com/vgforum/index.php?topic=5420.0
Cheers,
Yacine
Title: Re: Connector End point reads text at hooked-up shape?
Post by: novski on April 23, 2014, 06:26:34 AM
oh. Thanks. I will go through that later.

If you could give a quick answer about the possibility of briefly described: a connector that connects to a shape in a group..

I have a group of shapes and several connection points on different shapes. But just one of the shapes has Shape-Data and in this data there is a row that describes the name of the whole group. Is it possible to determine which shape in the group has shape data, to get the name, somehow?
Title: Re: Connector End point reads text at hooked-up shape?
Post by: Jumpy on April 23, 2014, 07:53:38 AM
Short Answer: Yes that is possible with code.

The steps:
- Detect connection / use connection added event to fire your code
- Identify the shape the connector connected to
- Look at this shapes parent:
-- if it's another shape, repeat: look at it's parent
-- if it's the page, you have found the group shape that contains all your shapes in that group
- Starting from the group shape: Loop through all shapes in the group and look for the one with the Shapedata
Title: Re: Connector End point reads text at hooked-up shape?
Post by: novski on April 23, 2014, 08:37:19 AM
hmm. now im currious!  ;D
have to go do this now... im shure im back with tonnes of quesions in a few minutes.  8)
thanks for the step through...
novski
Title: Re: Connector End point reads text at hooked-up shape?
Post by: novski on April 23, 2014, 12:24:15 PM
Ok not many questions but one big.

O managed (in 3h  :o) to  get a shape load a VBA script. It makes a message box telling me the script is done.

MsgBox "done!"

But that's all.
So i defensively need some help.
i didn't find a connection added event. Instead i found a argument called Connect.ToCell

If you wold write me the full name of the event i can google it and may find a was to go on..

thanks
novski
Title: Re: Connector End point reads text at hooked-up shape?
Post by: aledlund on April 23, 2014, 12:30:30 PM
you might want to check this out
http://blog.bvisual.net/2014/04/08/adding-configure-callout-functionality-to-visio-callouts/

al
Title: Re: Connector End point reads text at hooked-up shape?
Post by: novski on April 24, 2014, 05:36:52 AM
Wow.
That means there is a way to get the data of a connected shape witout VBA!
I love the way Microsoft hides their work.
It always fills me with pleasure when i find a new hidden item!
Title: Re: Connector End point reads text at hooked-up shape?
Post by: vojo on April 24, 2014, 12:35:17 PM
runaddonwargs = VBA code they wrote

There is NO way to dynamically pull info from shape to another shape via shapesheet etc.