Group Shapes

R

RINKS

Hi...
i am adding two shapes on the documents through


dim sh as word.shape

sh=activedocument.shapes.addpicture()
and
sh=activedocument.shapes.addlabel()

Now how can we group these objects using VBA
code.

Thanks
 
C

Chad DeMeyer

Rinks,

dim sh as word.shape
dim shrg as word.shaperange

set sh = activedocument.shapes.addpicture()
sh.Name = "myPic" 'your choice
set sh = activedocument.shapes.addlabel()
sh.Name = "myLabel" 'your choice
set shrg = activedocument.shapes.range(array("myPic", "myLabel"))
set sh = shrg.group

Group method of a shaperange object groups the shapes in the specified range
and returns the groups shapes as a single shape object.

Regards,
Chad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top