Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a shape to a group with VBA in Visio

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.

like image 981
Nicolas Thery Avatar asked Oct 06 '22 14:10

Nicolas Thery


1 Answers

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.

like image 127
Nicolas Thery Avatar answered Oct 17 '22 03:10

Nicolas Thery