How Generating and changing shapes from VBA code in Visio 2003??

E

Erik Wel

Hi,

I would like to generate shapes in vba code simply by clicking a
button on a visio drawing. And then draw some objects in a basic
flowchart structure.

I know VBA but not in Visio.
What I did to start this was recording a macro where i drag a Process
on my drawing.
This gave me this code:

Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU("Page-2")
Application.ActiveWindow.Page.Drop
Application.Documents.Item("BORDER_M.VSS").Masters.ItemU("Title block
classic"), 2.362205, 11.062992

So i copied this code in my project for drawing an object.
and running this code i got an object on my screen.

Now I want to move (for example) this object but how do I do that????
how can i select this object in code by NAME or ID to put it somewhere
else or to group or link it with another object???

I know that when you have an object called "square" on your page you
can
make it an object by doing this
Set shpObj = Visio.ActivePage.Shapes.Item("Square")
and then do your thing with shpObj.
But how do I make an object by code that has the name "square" or an
Id that I choose. Now it gets an Id you do not know so i cannot "grab"
the object.

It must be kinda simple i guess but I dont know how.

Please help!
 

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