How to Programmatically Change Layout Style

P

paxton

Hi,

My C# application generates a Visio organization chart from the contents of
a database. By default it performs the Radial layout when Page.Layout() is
called. I would like to change it so that "Compact Tree" layout is perfomed,
but I can't figure out how to change this setting programmatically. Any help
is appreciated.
 
C

Chris Roth [ Visio MVP ]

If you go to a drawing page, select no shapes, and choose Window > Show
ShapeSheet, you'll see a Page Layout section.

When you change settings in the Layout dialog boxes, cells in the ShapeSheet
will change values and formulas. Make a not of what changes, then set this
programmatically.

You can set values or formulas. In VB.NET (aka readable C#) it looks like
this:

dim shpPg as visio.shape
shpPg = Visio.ActivePage.PageSheet

shpPg.Cells("PlaceStyle").ResultIU = 1
shpPg.Cells("PlaceDepth").FormulaU = "1"

--

Hope this helps,

Chris Roth
Visio MVP
 

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