MS Word Drawing Buttons via VBA

S

szcz.andrew

Hi All,

I'm trying to perform the equivalent of 'pressing' a drawing button
(line, circle, square, group, ungroup, etc.) in MS Word 2000+ (needs
to work with 2007 as well). I'm having problems figuring out how to
do this - most other functions I was able to simply run a macro or
perform using the appropriate VBA object. With the drawing functions,
I am having problems finding equivalent functionality in VBA or in the
macros - can anyone help?

Cheers,
Andrew
 
J

Jonathan West

Hi All,

I'm trying to perform the equivalent of 'pressing' a drawing button
(line, circle, square, group, ungroup, etc.) in MS Word 2000+ (needs
to work with 2007 as well). I'm having problems figuring out how to
do this - most other functions I was able to simply run a macro or
perform using the appropriate VBA object. With the drawing functions,
I am having problems finding equivalent functionality in VBA or in the
macros - can anyone help?

Cheers,
Andrew

You insert an autoshape by adding to the Shapes collection of a document.
Depending on the type of Shape you want to add, there are a variety of
methods of the Shapes collection, e.g. AllCallout, AddLine, AddTextBox etc.
Each method has a slightly different set of parameters appropriate to that
shape type allowing you to specify what is inserted.
 
Top