Org Charts Auto-arrange in VBA

Jump to:

Sponsored Links

Next

1. How can I export a revised database model diagram back into ms ac.How does Visio facilitate exporting revisions on the database diagram back to
the ms access database? I want to do my database design in visio and then
export the data tables etc to ms access. I recognise the Reverse Engineering
function, but how does it work the other way?

2. Automate Best Fit to Page (Org Charts)I'm using Visio 2003 to generate org charts and I was wondering if
there was a way to run the "Best Fit to Page" command found under the
org chart menu from vba?
THANKS,
Casey

3. Visio help !We have written an ATL COM component for Invoking Visio Application using
Visio 2002 SDK.
We are reusing this component in ASP.NET environment to Invoke Visio
Application.
We are able to invoke Visio 2002 application correctly.
We are not able to invoke Visio 2003 application.
For supporting Visio 2003 application, we rebuilt our ATL COM component
using Visio 2003 SDK.
But still we are not able to open Visio 2003 application.
We have observed that vaoGetObjectWrap(CVisioApplication App) API is
returning 0 (Failure).
Please suggest.
Thanks!

4. Passing Custom Properties from a Shape to VBA FormHello,
I would like to create a form in VBA where I can list and modify
Custom Properties from a Shape that contains them. What I
particularly need help with is:
1 - How to reference the macro from the 'Double Click' setting for a
macro of your choice in its behaviour?
2- How to pass all the shape's properties, including the custom
properties from the selected Shape File (by the behaviour of 'Double
Click' into the form where they can be shown?
3 - (optional) How could I spell check each Custom Property's text
value?
Thank you for your kind clarification and assistance.
Regards,
Colin Sheppard.

Org Charts Auto-arrange in VBA

by peter.allan » Thu, 28 Sep 2006 18:05:24 GMT

Hello, I'm trying to automate the creation of org-charts using Visio
VBA. I can create the org charts and do a certain amount of
manipulation, however I am struggling to "re-arrange" the shapes on the
page once the chart has been created.
The Org Chart Wizard tends to put subordinates in 2 columns below a
Manager, even where there are 30 or 40 subordinates and the shapes run
off the bottom of the pages. Manually I can improve this by selecting
the Manager, going to Shape -> Actions -> Arrange subordinates on the
menu, and clicking on the relevant button to re-arrange the shapes into
4 columns.
So is there any way I can run this 'auto-arrange' option in VBA ? I
cannot find anything in the Language References on the Microsoft site.
Even better would be some examples of how I can 'move' shapes around
the page more generally so I can move into (for example) 6 columns.
I have also seen reference on here to changing the orgch_u.vst file,
however I don't have one on my pc (I'm using Visio 2000), and I don't
know if it would help in this case anyway.
Any help is greatly appreciated,
Thanks,

RE: Org Charts Auto-arrange in VBA

Re: Org Charts Auto-arrange in VBA

by Chris Roth [MVP] » Wed, 04 Oct 2006 20:16:55 GMT

Hi Peter,
I found one of my posts from a few weeks ago related to this topic, and have
pasted it below. Have a look!
--
Hope this helps,
Chris Roth
Visio MVP
More Visio shapes, articles, development info and pure diagramming fun at:
www.wanderkind.com/visio
-----------------------------------------------------
Org Chart Commands
-----------------------------------------------------
Two ideas:
One, you can analyze the Orgchart menu via Visio's UI object to see what the
commands are. Since I don't do this sooo often, I always forget and find it
a bit of a pain...just laziness really.
Two, select an orgchart shape and choose Window > Show ShapeSheet. In the
Actions section, you'll see a bunch of formulas with RUNADDONWARGS. The
add-on is called OrgC11, and you can see a whole slew of parameters that can
be fed to it.
Looking at this, I took a lucky guess and figured "/cmd=LayoutPage" would do
what you needed. Sure enough it works. So you can test in VBA using this
line of code:
Call Visio.Application.Addons.ItemU("OrgC11").Run("/cmd=LayoutPage")
-----------------------------------------------------

Re: Org Charts Auto-arrange in VBA

by peter.allan » Sat, 14 Oct 2006 19:01:08 GMT

Hi Chris,
Thanks for your reply. Regarding the info in your post - when I look at
the ShapeSheet for the employees in my Org Chart the RUNADDONWARGS
seems to be different from yours - there is no add-on called "orgc11",
and no /cmd=Layoutpage option. The only add-on is "orgc".
Do I need to get a new version of Visio (I'm currently using Visio Pro
2002 SR-1) ?
Or is this "orgc11" add-on downloadable, or installable, somehow ?
Thanks very much for any help,
Regards,
Peter.

Similar Threads:

I'm creating an org chart in Visio 2003 that is linked to a database.
I can get the employee data to update in the chart but I would like to
get the inserted pictures and hyperlinks to update based on a path/etc.
contained in database fields. I've been digging through the Visio
developer help but haven't come up with much so far. Any help would be
appreciated.
Thanks

Hi
Can someone recommend a Org Chart or a Flow Chart Control which I could use
with vbs?
I would only use the control to display a chart. Functions for modifications
like an Editor is not a need.
Thank's
Michel

I would be very interested in that code, as that is what I am trying to
accomplish...
Dan Sears wrote:
> I wrote some VBA code in MS Access to create an org chart with VISIO
without
> using the import feature.
> I use tables in the Access app to supply the data. I open Visio from
the
> VBA, drop the top manager, then drop the rest of the employees in
their
> proper positions based on the "ReportsTo" field. If you're interested
I
> could e-mail you a copy of the mbd.
>
> Dan Sears
>
>
> "Randal Greene" < XXXX@XXXXX.COM > wrote in message
> news:OnnftUsqBHA.1596@tkmsftngp07...
> > I'd like to automate creating an org chart using data we have in
our
> > Access/SQL HR app. Visio has a simple feature for
importing/exporting org
> > data via csv, however I can't seem to access the org data
import/export
> > feature using VBA. Is this possible? If not, I am new to Visio
VBA, so
> > what is the basic approach to creating the org chart object by
object
> using
> > code - do you use the Shapes collection?
> >
> > Thanks in advance...
> >
> >

I'm creating an org chart in Visio 2003 that is linked to a database.
I can get the employee data to update in the chart but I would like to
get the inserted pictures and hyperlinks to update based on a path/etc.
contained in database fields. I've been digging through the Visio
developer help but haven't come up with much so far. Any help would be
appreciated.
Thanks