Welcome to MSDN Blogs Sign in | Join | Help

Visio: Programmatically creating an org chart from a simple text file

As a believer in the power of simple text formats, I wrote a tool to help make it easy to quickly draw org charts in visio by starting in notepad. It’s useful for more than “org charts” youcan use it to quickly render any simple hierarchical data.

 

Quick summary

  • The VisioAutoExt library now contains a command-line tool called MakeOrgChart
  • MakeFlowChart accepts simple indented text file draws an org chart based on the indentation level

Command-Line Usage

C:\>MakeOrgChart.exe d:\input1.txt

Example 1 – the input text file

 

Charlie
    Tim
        Chris
        Mort
    Julia
        Alice
        Akuma

 

Example 1 – the output drawing

image

 

Example 2 – the input text file

This example illustrates

  • a much larger orgchart
    • these org charts will tend to be very horizontal. you’ll have to use Visio’s org chart tools to re-layout sections to meet your needs
    • The larger these get, the longer it takes visio to draw them using its layout algorithm.
  • multiple roots nodes in the org chart
    • the drawing will compensate by adding a placeholder “ROOT” node, which you can manually delete
  • using the vertical bar character to add linebreaks in the the text

 

Charlie | President and CEO
    Tim | IT Manager
        Chris | Operations Engineer
        Simon | System Implementer
        Isaac | ISV Biz App Developer
        Mort | IT Systems Developer       
        Sean | Power User 
        Ivar | Inexp. VAR Sys Imp 

    Julia | Marketing Executive
        Kevin | Sales Manager
        Nicole | Marketing Staffer
        Benjamin | Marketing Manager
        David | Dedicated Sales Rep
        Michael | Account Manager 
        Susan | Order Processor 

    Marie | Cust. Serv Ops Mngr 
        Lisa | Cust. Service Rep 
        Daniel | Dispatcher 
        Rebecca | Receptionist/Admin 
        Terrence | Outbound Technician 
    Vince  | Operations Manager 
        Karl | Materials Manager 
        Ellen | Warehouse Manager 
        Inga | Purchasing Manager 
        Sammy | Shipping & Receiving 
        Alicia | Purchasing Agent 
        John | Warehouse Worker 
        Ted | Transportation Coord. 
        Tony | Production Manager 
        Lars | Shop Supervisor 
        Oscar | Process Engineer 
        Shannon | Machine Operator 
        Eduardo | Production Planner 
        Heather | Human Resources 
        Ricardo | Quality Assurance 
        Emil | Product Designer 
        June | Dir. of Prof. Services 
        Prakash | Project Manager 
        Reina | Resource Manager 
        Tricia | Project Team Member 
    Sara | CFO 
        Phyllis | Accounting Manager 
        Ken | Controller 
        Cassie | Accountant 
        Penny | Payroll 
        Arnie | Accounts Receivable 
        April | Accounts Payable 
        Annie | Bookkeeper 
        Connie | Credit & Collections Manager 
    Claire | HR Director / Manager 
        Brooke | HR Assistant 
        Grace | Training/Development Manager/ Specialist
        Jacob| Staffing Recruitment Manager/Specialist
        Jodi | Copensation and benifits Manger 
        Luke | HR Generalist

Stan |Small Business Owner 
    Debra | Office Manager 
    Lacy | Store Operations Mngr 
    Jeremy | Cashier 

 

 

Example 2  – the output drawing

Drawing4

Published Wednesday, June 04, 2008 4:06 PM by saveenr

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Visio: Programmatically creating an org chart from a simple text file

Hi, I am glad i found this tool suggestion. Just a question is it possible to do something similar without using visio like in excel/powerpoint or word. Visio is cumbersome and expensive and people in my organization do not want to pay for it.

is there away to do this using VBA in other office products.

Please let me know.

squidoofleur@yahoo.com

Monday, April 27, 2009 8:43 PM by A. Long

# re: Visio: Programmatically creating an org chart from a simple text file

It should be possible to use the same technique using Powerpoints automation APIs instead of Visio's APIs.

This MSDN link shows some of the drawing APIs available for PowerPoint: http://msdn.microsoft.com/en-us/library/aa221434(office.11).aspx

And this link shows how they can be used:

http://www.s-anand.net/blog/automating-powerpoint-with-python/

Tuesday, April 28, 2009 8:17 AM by saveenr

# re: Visio: Programmatically creating an org chart from a simple text file

It should be possible to use the same technique using Powerpoints automation APIs instead of Visio's APIs.

This MSDN link shows some of the drawing APIs available for PowerPoint: http://msdn.microsoft.com/en-us/library/aa221434(office.11).aspx

And this link shows how they can be used:

http://www.s-anand.net/blog/automating-powerpoint-with-python/

Tuesday, April 28, 2009 8:17 AM by saveenr

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker