Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    USA
    Posts
    223
    Thanks
    1
    Thanked 0 Times in 0 Posts

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

    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).Toshee t.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

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts
    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
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. The Following User Says Thank You to Andrew Lockton For This Useful Post:

    VBA-Bumbler (2011-03-30)

  4. #3
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    USA
    Posts
    223
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •