Detecting org-chart diagram

Started by Nikolay, March 29, 2011, 03:28:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nikolay

How do I detect that a diagram is actually an org-chart diagram?
I'm interested in moderately robust method to detect that.

I haven't found any either document- or page- cells in org-chart shape-sheets that define this;
that is, Visio thinks that diagram is an org-chart diagram (i.e. shows "org-chart" tab) even if I remove every single cell in every "prop" and "user" sections.

Is analyzing <SolutionXML> element a good way to check that actually diagram is an org-chart diagram?
Maybe there is an easier approach?

There is also a user cell User.DocClass="{429428D1-A7E7-11d1-B2BD-006008BD347E}", which seems to be specific to org-chart,
and looks exactly like what I want, but what frightened me was that even after I had removed this cell, Visio still "thought" that diagram was an org-chart diagram.

Thanks!

aledlund

In the action section of the shapes you will usually find something like this
RUNADDONWARGS("OrgC11","/cmd=LayoutDlg")
which obviously calls the org chart add-on.

Additionally there are a set of persistent events that are stored in the document that call the add-on.

al

Nikolay

#2
Al, thanks!

I need to detect that programmatically, I afraid I might not mention that;
Do you know, is that line in persistent events common for all version of Visio (i'm interested in 2003, 2007, 2010), so that it can be used as a "marker"?
I.e. is "OrgC11" addon name same for all Visio versions?

aledlund

Nikolay,
I didn't check the events, but the shapes do call the same add-on (orgc11).
al

Visio Guy

The first page in an Org Chart document has a User-cell: User.DocClass = "{429428D1-A7E7-11d1-B2BD-006008BD347E}". More clues that a document is (supposed to be an) org chart.

Also, a VBA test:

?visio.ActiveDocument.Template
C:\Program Files\Microsoft Office\Office14\visio content\1033\ORGCH_U.VST

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Nikolay


The thing that confuses me about the "User.DocClass" is that even if you remove this guid (or the "User" section as a whole), and close the the stencil as well, Visio still understands that the diagram is an org-chart diagram; so probably it uses some sort of different detection mechanism, which most probably is that it simply runs the persistent event handlers which activate the org-chart menu and functions.

But I think I will go with this guid anyways (that appears to be written by Visio into the document sheet for orgchart diagrams)
And if a user removes this guid, which seems to be highly unlikely, he could well be considered being an evil pinocchio to himself, right :)

Using shapes for this sort of detection does not seem to be an option for me, because an org-chart diagram may not contain shapes at all, so I won't be able to analyze them to see addon name, right.