Change shape properties from vba

P

palomino100

Hi!
I'm trying to write a vba code to autocreate UML model Diagrams. Now,
from VBA editor of VISIO, i can create classes with this code:

Code:

Public Sub TestDropShape()
'Dibuixa les classes millor que l'anterior
Dim stencil As Visio.Document, objshape As Visio.Master
Set stencil = ThisDocument.Application.Documents.Open("UML Static
Structure.vss")
ThisDocument.Application.Windows(ThisDocument.Index).Activate
'Set the ActiveWindow to the drawing window.
Set objshape = stencil.Masters("Class") ' Get the master named
"Circle" and drop that shape on the page!

ThisDocument.Pages(1).Drop objshape, 1, 3 ' Drop the shape,
mstCircle, at location X=1 Y=3
End Sub


But now i'd like to change their properties from vba, like new
methods, properties... Do you know if there is anyway to do this?

Thanks!


Carlos
 
P

Paul Herber

Hi!
I'm trying to write a vba code to autocreate UML model Diagrams. Now,
from VBA editor of VISIO, i can create classes with this code:

Code:

Public Sub TestDropShape()
'Dibuixa les classes millor que l'anterior
Dim stencil As Visio.Document, objshape As Visio.Master
Set stencil = ThisDocument.Application.Documents.Open("UML Static
Structure.vss")
ThisDocument.Application.Windows(ThisDocument.Index).Activate
'Set the ActiveWindow to the drawing window.
Set objshape = stencil.Masters("Class") ' Get the master named
"Circle" and drop that shape on the page!

ThisDocument.Pages(1).Drop objshape, 1, 3 ' Drop the shape,
mstCircle, at location X=1 Y=3
End Sub


But now i'd like to change their properties from vba, like new
methods, properties... Do you know if there is anyway to do this?

I believe the built-in UML add-on won't allow you do do this, all its
internal operations are hidden.

I've created a Visio add-on that can create UML diagrams:
http://www.sdl.sandrila.co.uk/

For what you want to do just add property and methods text to the
appropriate sections of a Class symbol. There is nothing more to it
than that.
 
A

AlEdlund

check out the visio sdk, it has examples on how to create/change shape data.
al
 

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