5

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,319
  • 4
  • 26
  • 36

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
  • 16,685
  • 2
  • 45
  • 81
Nicolas Thery
  • 2,319
  • 4
  • 26
  • 36