Subordinates layout using vba

S

steve

I was wondering if anyone could help me with changing the layout of
subordinates programmatically in an organizational chart.


Thanks,
Steve
 
J

JuneTheSecond

My understanding what you mean about changing the layout is to replace two
shapes or to change the order, if so how would you like to start with replace
two shapes.
Sub test()
Dim mySelection As Selection
Set mySelection = ActiveWindow.Selection
If mySelection.Count = 2 Then
ReplaceShapes mySelection(1), mySelection(2)
End If
End Sub
Sub ReplaceShapes(shp1 As Visio.Shape, shp2 As Visio.Shape)
Dim Ddumy As Double
Ddumy = shp1.Cells("PinX")
shp1.Cells("PinX") = shp2.Cells("PinX")
shp2.Cells("PinX") = Ddumy
Ddumy = shp1.Cells("PinY")
shp1.Cells("PinY") = shp2.Cells("PinY")
shp2.Cells("PinY") = Ddumy
End Sub
 

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