Adding swimlane in C# in Visio 2003

Started by daunter, August 05, 2011, 09:03:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

daunter

Hi ,

I want to create a swimlane and add it into a cross func. diagram.

Help please.

daunter

There is a DropIntoList method in 2010 , however this is new in 2010 and i have to implement it with 2003

Jumpy

Drop it on the page like any other shape, I  guess. The FlowChart-AddOn should take over from that on.

daunter

Unfortunately , the flowchart dont make it automaticly.

Jumpy

What I had in mind (VBA-PseudoCode as I have no Visio today):


Dim Stencilname as String
Dim Mastername as String
Dim st as Visio.Document
Dim mst as Visio.Master
Dim shp as Visio.Shape
Dim pg as Visio.Page

Stencilname = "NameOfFlowCHartStencil"
Mastername = "NameOfSwimlaneMastershape"
Set pg = ActivePage

'Check if Stencil is open otherwise open it
Set st = Application.Documents.OpenEx(Stencilname, SomeMode)

'Get Master
Set mst = st.masters(Mastername)

'Drop it somewhereon page
Set shp = pg.Drop(mst,30,30)

'Now FlowChart-AddOn should catch the swimlane and place it beside the rest.
'If not you have to place it here with further Code.
'In the shp you could now search for the Subshape, that contains the Text/Headline of the swimlane and place your text there.


daunter

i try the same , it does not catch the swimlane and place it beside the rest

Jumpy

Thats the problem, when working with templates that have AddOns. You can't really depend on them, because there's no true documentation. Don't know how you could trigger the AddOn. Maybe one of the more expirienced guys has an idea or suggestion.