"glueing" text boxes to the dynamic connector

N

nanoo

Hi. I am trying to create a special dynamic connector by adding two
textboxes to the line ends. Can anyone help me? I need the text boxes
to stay "glued" to their positions on the line.

Thanks
 
J

JuneTheSecond

If you would like to use vba, you moght use ConnectionsAdded events
and ConnectionsDeleted events to the page object.
If you dont wish to use any programing language, you could do using
shapesheet. It is very simple, you might just put a formula in
shapesheet of your connector.

A. For VBA

This is an example to add an arrow to the simple line when connected.
Private Sub myPage_ConnectionsAdded(ByVal Connects As IVConnects)
Set myShape = ActivePage.Shapes(Connects.FromSheet.Index)
If Not myShape.Cells("BeginX").Formula Like "*mm" Then
myShape.Cells("BeginArrow").FormulaU = "13"
End If
If Not myShape.Cells("EndX").Formula Like "*mm" Then
myShape.Cells("EndArrow").FormulaU = "13"
End If
End Sub

Private Sub myPage_ConnectionsDeleted(ByVal Connects As IVConnects)
Set myShape = ActivePage.Shapes(Connects.FromSheet.Index)
If myShape.Cells("BeginX").Formula Like "*mm" Then
myShape.Cells("BeginArrow").FormulaU = "0"
End If
If myShape.Cells("EndX").Formula Like "*mm" Then
myShape.Cells("EndArrow").FormulaU = "0"
End If
End Sub

B. For ShapeSheet

1. You wold make user defined section, and put a formula on value
cell of User.Row1.
IF(BegTrigger=2,IF(EndTrigger=2,"Both Ends Connected","Start Point
Connected"),IF(EndTrigger=2,"End point Connected","Both Ends Free"))

2. You would insert a field with menu Insert/Field, put a formula
"User.Row_1" in Value cell of Text Field.
 

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