This is the sample,
but may have many problems.
Option Explicit
Private Assemble As Collection
Private FillColor As Long
Sub LockRelativePosition()
Dim shp1 As Visio.Shape, shpA As Visio.Shape
Dim I As Long, N As Long
Dim MySelection As Selection
Dim DeltaX As Double, DeltaY As Double
Set Assemble = New Collection
Set MySelection = ActiveWindow.Selection
Set shp1 = MySelection(1)
FillColor = shp1.Cells("FillForegnd")
shp1.Cells("FillForegnd") = 2
Assemble.Add shp1
N = MySelection.Count
For I = 2 To N
Set shpA = MySelection(I)
Assemble.Add shpA
DeltaX = shpA.Cells("PinX") - shp1.Cells("PinX")
DeltaY = shpA.Cells("PinY") - shp1.Cells("PinY")
shpA.Cells("PinX").Formula = "GUARD(" & shp1.Name & "!PinX+" &
DeltaX & ")"
shpA.Cells("PinY").Formula = "GUARD(" & shp1.Name & "!PinY+" &
DeltaY & ")"
Next
End Sub
Sub UnLockRelativePosition()
Dim shp1 As Visio.Shape, shpA As Visio.Shape
Dim I As Long, N As Long
Dim DeltaX As Double, DeltaY As Double
N = Assemble.Count
Set shp1 = Assemble(1)
shp1.Cells("FillForegnd") = FillColor
For I = 2 To N
Set shpA = Assemble(I)
DeltaX = shpA.Cells("PinX") - shp1.Cells("PinX")
DeltaY = shpA.Cells("PinY") - shp1.Cells("PinY")
shpA.Cells("PinX").FormulaForce = shp1.Cells("PinX") + DeltaX
shpA.Cells("PinY").FormulaForce = shp1.Cells("PinY") + DeltaY
Next
End Sub