Need faster way to group shapes

L

Lloyd Catlett

I've some VBA code (Word 2000 on Vista or Word 2003 on XP) that creates
hundreds of shapes (lines or ovals) used to plot graphs of functions. I
capture the shape names in an array, then use the array to group the shapes
using code similar to the following:

ActiveDocument.Shapes.Range(MyShapesArray).Select

It works, but with hundreds of shapes it takes sooooooo long! It appears
Word is refreshing the displayed shapes for every one that gets grouped (at
least I see the shape handles as the grouping is taking place.) The
displayed shapes "flicker" as the grouping is taking place.

Is there a way to speed this up? Perhaps by somehow hiding the shapes as
the grouping is taking place to avoid seeing all the shape handles?
 
M

macropod

Hi Lloyd,

If you're seeing screen activity, that suggests you haven't set Application.ScreenUpdating = False. Doing that should accelerate
your code.
 
L

Lloyd Catlett

WOW! That was GREAT! Thanks so much for the help.

--
L. Catlett


macropod said:
Hi Lloyd,

If you're seeing screen activity, that suggests you haven't set Application.ScreenUpdating = False. Doing that should accelerate
your code.

--
Cheers
macropod
[Microsoft MVP - Word]


Lloyd Catlett said:
I've some VBA code (Word 2000 on Vista or Word 2003 on XP) that creates
hundreds of shapes (lines or ovals) used to plot graphs of functions. I
capture the shape names in an array, then use the array to group the shapes
using code similar to the following:

ActiveDocument.Shapes.Range(MyShapesArray).Select

It works, but with hundreds of shapes it takes sooooooo long! It appears
Word is refreshing the displayed shapes for every one that gets grouped (at
least I see the shape handles as the grouping is taking place.) The
displayed shapes "flicker" as the grouping is taking place.

Is there a way to speed this up? Perhaps by somehow hiding the shapes as
the grouping is taking place to avoid seeing all the shape handles?

.
 

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