I am trying to group a variable number of shapes to help with the process of flowcharting a program. I realise that I should really be doing it in Visio, but I am using Word.
I have based my code on that which is created by a macro -
ActiveDocument.Shapes.Range(Array("AutoShape 4758", _
"Line 4759", "Line 4760")).Select
Selection.ShapeRange.Group.Select
I have changed this to
ActiveDocument.Shapes.Range(Array(strGroup)).Select
Selection.ShapeRange.Group.Select
Each time a shape or line that is to be added to the group is added to the Shapes Collection, I add its name to the string variable strGroup. When all the shapes have been created, if I paste the contents of strGroup into the brackets it works, but if I use the name of the string, then I get run time error '9'
The item with the specified name wasn't found.
Has anyone else tried something similar please?
Many thanks
Peter Kinsman
I have based my code on that which is created by a macro -
ActiveDocument.Shapes.Range(Array("AutoShape 4758", _
"Line 4759", "Line 4760")).Select
Selection.ShapeRange.Group.Select
I have changed this to
ActiveDocument.Shapes.Range(Array(strGroup)).Select
Selection.ShapeRange.Group.Select
Each time a shape or line that is to be added to the group is added to the Shapes Collection, I add its name to the string variable strGroup. When all the shapes have been created, if I paste the contents of strGroup into the brackets it works, but if I use the name of the string, then I get run time error '9'
The item with the specified name wasn't found.
Has anyone else tried something similar please?
Many thanks
Peter Kinsman