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!
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!