Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: bernd on June 05, 2016, 12:40:12 PM

Title: Find out informations of a connected (glued) shape
Post by: bernd on June 05, 2016, 12:40:12 PM
Hello all together..
another problem to solve :-) .. probably it is easy for you, but not for me  :-\

I have different rectangle shapes connected via connection shapes..
I "just" want to work with the connection shapes - but with some informations given in the rectangle shape connected to..

How can I find out within the shapesheet, what the connected rectangles shape (name) is?
In the section Glueinfo are different information.. i.e. BegTrigger and EndTrigger.. but how to seperate the shape-name?
Using stringhandles or something like that?

Perhaps someone could help me?
Thank you in advance for your support..

BR Bernd
Title: Re: Find out informations of a connected (glued) shape
Post by: JuneTheSecond on June 05, 2016, 11:29:22 PM
I recommend you to study about connect object.
I feel not easy for me to understand it.
https://msdn.microsoft.com/en-us/library/office/ff768985.aspx
Title: Re: Find out informations of a connected (glued) shape
Post by: wapperdude on June 06, 2016, 12:34:59 AM
See attached file.  It generates an Excel file (or modify code to get a List Box).

The code has a lot of comments, so hopefully, it'll be easy to follow.

You do NOT have to select a shape to run the macro.

Wapperdude
Title: Re: Find out informations of a connected (glued) shape
Post by: bernd on June 06, 2016, 02:00:32 PM
Hello folks,
thank you very much... unfortunately I didn´t mentionedth that I want to use the shapesheet, avoiding VBA.

Could it be so difficult to use the connection partners name of a 1-D shape (Begin) which is already given in the GLUE INFO?
(i.e. =_XFTRIGGER(Nutzer.4!EventXFMod) ---->  I need the string: Nutzer.4 
using a prop.value of the Nutzer.4 in the user-defined cells of my connection shape.

Sorry for forgotten that in the previous post.
Could you anyway help me?

BR
Bernd

Title: Re: Find out informations of a connected (glued) shape
Post by: JuneTheSecond on June 07, 2016, 07:13:27 AM
I cannnot find out any Visio shapesheet  function that can get formula in a cell as a string.
If VBA, it is easy.



Option Explicit

Sub test()
    Dim shp As Visio.Shape
    Dim frm As String
    Dim subTxt As String
    Dim ShapeName As String
    Set shp = ActiveWindow.Selection(1) ' Connecotor must be selected.
    frm = shp.Cells("BegTrigger").FormulaU
    subTxt = Right(frm, Len(frm) - 11)
    ShapeName = Left(subTxt, Len(subTxt) - 12)
   
    Debug.Print ShapeName
End Sub


Title: Re: Find out informations of a connected (glued) shape
Post by: Surrogate on June 07, 2016, 07:30:54 AM
This article by David J Parker can help too
Quote from: David J Parker (https://about.me/david_j_parker) в статье Getting the Name of Glued Connection Points (https://blog.bvisual.net/2013/05/21/getting-the-name-of-glued-connection-points/)A Visio developer asked me if it is possible to get the name of connection points that a connector is glued to in Visio. Well, it is not possible directly from the ShapeSheet, but is easy if you use a little code.