• How to find direction of arrow (connector) in Visio?

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » How to find direction of arrow (connector) in Visio?

    Author
    Topic
    #475748

    I love this forum! I learn from reading and get feedback on all kinds of weird stuff I try. Now I’m trying to write a macro in VISIO to generate a page of details for each connector in a diagram (long story, we looked at data fields and other ways to do this and the committee decision is to go this way) and I ran into a problem I would appreciate your help with. I can’t find anything from the search here, and recorded macros are just confusing to me.
    I can find the text in the connector label, and the names of the two connected shapes but I can’t figure out how to tell what direction the arrow is facing.
    ThisDocument.Pages(x).Shapes(x).Connects(x).Tosheet.Characters gives me the name of each connected shape. The sequence of the two connected shapes doesn’t change if I change the direction of the arrow so the sequence doesn’t tell me anything. I’m having trouble figuring out what a lot of the other things in the model are for but none of them seem to be giving me what I need. I just want to be able to identify which way the arrow is pointing (I need to identify the source and the destination). Any ideas? Thanks in advance for any info you can offer; even if it’s just a suggestion I can try out.
    Thanks
    :confused:

    Viewing 0 reply threads
    Author
    Replies
    • #1273979

      Although you could probably find the start and finish of a line, this might be misleading as Visio allows the user to change either end of a line. So a connector line might have an arrow appear at either the start or beginning or neither or both.

      In my opinion you would need to examine the shapesheet of a connector to work out the relevant information in VBA. I can see the LineFormat>BeginArrow and LineFormat>EndArrow in a default dynamic connector are styled with a theme(“ConnectorBegin”) and theme(“ConnectorEnd”) so this is even more complicated than I had hoped. This means you might also have to find out what the theme decides is a connectorbegin and connectorend.

      To work out what shapes the connector comes from/to appears to be Glue Info>BegTrigger and Glue Info>EndTrigger

      • #1274042

        I should have known this wasn’t going to be easy! Thanks for the help, I will have to play around with this to see if I can get what I need.
        Thanks
        Phil

    Viewing 0 reply threads
    Reply To: How to find direction of arrow (connector) in Visio?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: