4

How can you add a shape into an existing group in visio, without ungrouping because I have many custom properties into my group shapesheet. I dont want subformulas using it to be broken.

Here is the beginning of my VBA code but I can't find a method to add the shape in the group.

Sub moveToGroup(OrigineShape As Shape, DestinationGroup As Shape)


End Sub

Thank you all for your answers.

Nicolas Thery
  • 2,025
  • 3
  • 22
  • 34

1 Answers1

4

It was actually quite simple!

Sub moveToGroup(OrigineShape As Shape, DestinationGroup As Shape)
    OrigineShape.Parent = DestinationGroup
End Sub

Just remember not to use Set for this assignment, as doing so generates an error.

cxw
  • 15,429
  • 2
  • 37
  • 69
Nicolas Thery
  • 2,025
  • 3
  • 22
  • 34