Search code examples
c#vbainteropvisiovisio2013

creating link to sub process in visio using c# or vba


Hi i am creating visio shapes programatically using c#. In visio am creating composite diagrams ( sub - process ) using the below code.

 Visio.Shape    ParentShape = myShape;
 ParentShape.CreateSubProcess();  //it will create a sub diagram for the shape

using this am creating subprocess(composite) diagram for the shape. But now i need to link a sub process diagram to one or more parent shapes. In Visio it can be simply done by clicking Link to SubProcess option. But i want to acheive it in visio API..Is it possible to acheive it ..??

Question is:

How to assign a page to multiple shapes as sub-process in API .?


Solution

  • For linking a single page to multiple shape sub-process is done by adding the page name as hyperlink for that shapes , to which we need sub-process to be created.

     Visio.Hyperlink vsoHyperlink = ParentShape.AddHyperlink();
          vsoHyperlink.SubAddress = PageName;
    

    ParentShape - the shape for which the sup-process (or ) composite to be created.

    PageName- the name of the page or diagram in visio, which needs to be treated as sup-process (or ) composite