Organization Chart - Blocks

W

wireplay

All,

In the Organization Chart dropdown, you can select fields and then choose
blocks by the field name (Block 1, Block 2, etc.). These blocks then display
in the upper left, right, etc.

How can I assign these fields via code? I have scoured the web to no avail.

Thanks.
 
B

Barb Way

Each of the Organization Chart shapes which use the Block Text feature are
actually a group. The main text is part of the main shape geometry, and
then there are up to 4 'children' which represent the corner blocks. Once
you have a local Master on your Document stencil for a Position shape, for
instance, you can manipulate the master to update the values in the
sub-text items as needed.

To create an example, update a shape using the UI, and observe what gets
updated in the shapesheets. By the way - notice that you can't use the
Macro recorder to capture the actions taken by the solution. This is by
design - none of the actions taken by the add-on code (Org Chart or any
other) are recorded in Macro code. So reviewing the ShapeSheet is your
best bet.

Each grouped shape is a collection of Shapes, so you can programmatically
get the text items by accessing the Shapes collection of the main shape.

Barb Way
Product Support - Visio
Microsoft Corporation
[This posting is provided "As Is" with no warranties, and confers no
rights.]
--------------------
Thread-Topic: Organization Chart - Blocks
Subject: Organization Chart - Blocks
Date: Mon, 12 May 2008 00:07:00 -0700

All,

In the Organization Chart dropdown, you can select fields and then choose
blocks by the field name (Block 1, Block 2, etc.). These blocks then
display
in the upper left, right, etc.

How can I assign these fields via code? I have scoured the web to no avail.

Thanks.
 
S

Savian

Each of the Organization Chart shapes which use the Block Text feature are
actually a group.  The main text is part of the main shape geometry, and
then there are up to 4 'children' which represent the corner blocks.  Once
you have a local Master on your Document stencil for a Position shape, for
instance, you can manipulate the master to update the values in the
sub-text items as needed.

To create an example, update a shape using the UI, and observe what gets
updated in the shapesheets.  By the way - notice that you can't use the
Macro recorder to capture the actions taken by the solution.  This is by
design - none of the actions taken by the add-on code (Org Chart or any
other) are recorded in Macro code.  So reviewing the ShapeSheet is your
best bet.

Each grouped shape is a collection of Shapes, so you can programmatically
get the text items by accessing the Shapes collection of the main shape.

Barb Way
Product Support - Visio
Microsoft Corporation
[This posting is provided "As Is" with no warranties, and confers no
rights.]
--------------------
Thread-Topic: Organization Chart - Blocks
Subject: Organization Chart - Blocks
Date: Mon, 12 May 2008 00:07:00 -0700

All,

In the Organization Chart dropdown, you can select fields and then choose
blocks by the field name (Block 1, Block 2, etc.). These blocks then
display
in the upper left, right, etc.

How can I assign these fields via code? I have scoured the web to no avail..

Thanks.

Thanks Barb for the information. After a lot of investigation, I
discovered the above. However, the object model is extremely complex
and hard to code toward. I understand that a lot of this is legacy and
that Visio goes back a long way. The client agreed to switch to Nevron
for the diagramming so we can move past the issue. I love Visio as a
client tool but the object model is tough to work with.

I am keeping the code and this response in case I need to use it in
the future. Thank you again.

Alan
 
B

Barb Way

I'm sorry you had to use a different tool, but I'm sure you'll find other
occasions to play with Visio :)

Barb Way
Product Support - Visio
Microsoft Corporation
[This posting is provided "As Is" with no warranties, and confers no
rights.]
--------------------

Each of the Organization Chart shapes which use the Block Text feature
are> actually a group. The main text is part of the main shape geometry,
and> then there are up to 4 'children' which represent the corner blocks.
Once
you have a local Master on your Document stencil for a Position shape,
for> instance, you can manipulate the master to update the values in the
sub-text items as needed.

To create an example, update a shape using the UI, and observe what gets
updated in the shapesheets. By the way - notice that you can't use the
Macro recorder to capture the actions taken by the solution. This is by>
design - none of the actions taken by the add-on code (Org Chart or any
other) are recorded in Macro code. So reviewing the ShapeSheet is your
best bet.

Each grouped shape is a collection of Shapes, so you can programmatically
get the text items by accessing the Shapes collection of the main shape.

Barb Way
Product Support - Visio
Microsoft Corporation
[This posting is provided "As Is" with no warranties, and confers no
rights.]
--------------------
Thread-Topic: Organization Chart - Blocks
Subject: Organization Chart - Blocks
Date: Mon, 12 May 2008 00:07:00 -0700

All,

In the Organization Chart dropdown, you can select fields and then choose
blocks by the field name (Block 1, Block 2, etc.). These blocks then
display
in the upper left, right, etc.

How can I assign these fields via code? I have scoured the web to no avail.

Thanks.
Thanks Barb for the information. After a lot of investigation, I
discovered the above. However, the object model is extremely complex
and hard to code toward. I understand that a lot of this is legacy and
that Visio goes back a long way. The client agreed to switch to Nevron
for the diagramming so we can move past the issue. I love Visio as a
client tool but the object model is tough to work with.
I am keeping the code and this response in case I need to use it in
the future. Thank you again.
Alan
 
J

John.. Visio MVP

The org chart wizard is rather complex and you may have gone too deep.

When you change the positions in the block, you affect the drawing at the
document level. If you open one of the shapes, you will see a user cell named
"User.Prop" with a value like ="Name;Email;Title". This is where you should
be doing your changes. There is probably another area where this cell
inherits it's information, but in the brief scan I just did, I did not find
one.

The easiest way to find out what is going on is to save a simple orgchart as
an XML file, change the position dialog and save as a new XML file. Open the
files in something like Word and do a Document compare. THe affect your
changes made should be highlighted. You may want to replace all ">" with "> "
so there is more white space for the Document Compare to work with.

Need stencils or ideas? http://Visio.MVPs.org/3rdparty.htm
Need VBA examples? http://Visio.MVPs.org/VBA.htm
Common Visio Questions http://Visio.MVPs.org/common_questions.htm


Savian said:
Each of the Organization Chart shapes which use the Block Text feature are
actually a group. The main text is part of the main shape geometry, and
then there are up to 4 'children' which represent the corner blocks. Once
you have a local Master on your Document stencil for a Position shape, for
instance, you can manipulate the master to update the values in the
sub-text items as needed.

To create an example, update a shape using the UI, and observe what gets
updated in the shapesheets. By the way - notice that you can't use the
Macro recorder to capture the actions taken by the solution. This is by
design - none of the actions taken by the add-on code (Org Chart or any
other) are recorded in Macro code. So reviewing the ShapeSheet is your
best bet.

Each grouped shape is a collection of Shapes, so you can programmatically
get the text items by accessing the Shapes collection of the main shape.

Barb Way
Product Support - Visio
Microsoft Corporation
[This posting is provided "As Is" with no warranties, and confers no
rights.]
--------------------
Thread-Topic: Organization Chart - Blocks
Subject: Organization Chart - Blocks
Date: Mon, 12 May 2008 00:07:00 -0700

All,

In the Organization Chart dropdown, you can select fields and then choose
blocks by the field name (Block 1, Block 2, etc.). These blocks then
display
in the upper left, right, etc.

How can I assign these fields via code? I have scoured the web to no avail..

Thanks.

Thanks Barb for the information. After a lot of investigation, I
discovered the above. However, the object model is extremely complex
and hard to code toward. I understand that a lot of this is legacy and
that Visio goes back a long way. The client agreed to switch to Nevron
for the diagramming so we can move past the issue. I love Visio as a
client tool but the object model is tough to work with.

I am keeping the code and this response in case I need to use it in
the future. Thank you again.

Alan
 

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