need to pass the row number of a selected connection point to a fo

M

MBAstudnet

What I would like to do is, when a user has a connection point selected with
the connection point tool (turns pink); I would like to be able to find out
which row in the shape subsheet connections section is active. My goal is to
be able to send that information to a form and auto-populate data on the form
using the connection cell formulas.

Here is an example of something close to what I would like to do. In this
example even if you have a connection point highlighted the
Visio.ActiveWindow.Selection returns with the SHAPE name that contains the
connection point and not the connection point.

Private Sub UserForm_Initialize()

Dim VisSelSet As Visio.Selection
Dim VisShape As Visio.Shape

Set VisSelSet = Visio.ActiveWindow.Selection
If VisSelSet.Count <> 1 Then
ConnectionName.Text = ""
Else
Set VisShape = VisSelSet.Item(1)
ConnectionName.Text = VisShape.Name
End If
End Sub


Thank you for your time

-Brad
 
P

Paul Herber

What I would like to do is, when a user has a connection point selected with
the connection point tool (turns pink);

Unfortunately, I don't think the pink denotes that the connection
point is selected, just that it is the latest one to have been
created.
As far as I can tell this will always be the last connection point
with the index value equal to the connection point count.
 
M

MBAstudnet

This does not apply to my situation. I think I need to further define what my
project looks like. My situation will be dealing with connection points that
have been already created.

The bigger picture of what I am doing is giving connection points their own
labels. I do this by making a text box's PinX and PinY dependent on a
connection points X Y values. To make things easier for the end user I want
to keep them out of the shape sub sheet. To accomplish this I need to be able
to feed my form the shapeID of the text box to bind to the connection point,
the shape that the connection point resides on and finally the row number of
the connection point itself. from there I can assign the correct formulas in
the shape sub sheet based on values that the user provides about the way they
want it oriented.


The user will drag a shape from the stencil. This shape has some connection
points on it but nothing stops the user from adding more if they are needed.

When a shape is selected I can use the code that I posted in my original
post to find out what shape is selected and I can pass that to my form.

I can also find out if more than one shape is selected which one of those is
a text box and pass that value.

The only piece of the puzzle I am missing is how to find out which
connection point in the shape is actively selected.

In your last post you sated
"Unfortunately, I don't think the pink denotes that the connection point is
selected, just that it is the latest one to have been
created."

If you are adding connection points using the connection point tool what you
stated is true. However if you click on different preexisting connection
points in the same shape using the connection point tool then it will
highlight that connection point pink. That lead me to believe that somehow
you can find out what the actively selected connection point is. What I
desperately need is the line of VBA code that will return data to identify
the selected connection point.

Thank you for any help you can provide,

-Brad
 
D

David Parker

I don't think you can get the currently selected Connection Point in Edit.
I think you should consider a custom dialog that shows the selected shape
image with your own array of points over the top of it.
Your user can then use the custom dialog to select a connection point and
edit the label.
 
C

Chris Roth [Visio MVP]

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