Add shapes and change their color at the same time through VBA

C

consulttech2004

I want to use the ShapeAdded event so that when I add a shape from an
electrical stencil, the shape turns red (or green, or blue, or
whatever) so that it stands out from the rest of my drawing. Any
ideas on how to do this consistantly through VBA? Thanks in advance.

David
(VISIO Newbie)
 
J

John Goldsmith

Hello David,

For events, checkout this link:

http://msdn2.microsoft.com/en-us/library/aa201787(office.10).aspx (DVS -
Handling Visio Events)

For the change of fill colour, you can use the macro recorder (Tools / Macro
/ Record new macro...) to record the code as you make the changes manually
in the UI, which you can then integrate into you final solution.

Are you sure, by the way, that you can't achieve what you're after just
using the ShapeSheet? On what basis do you want the colour to change?

Best regards

John


John Goldsmith
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk
 

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