Creating & managing a Visio diagram by VBA 
Author Message
 Creating & managing a Visio diagram by VBA

Hi,

I am attempting to use OLE to create a new organisation chart-type
diagram using Lotus Notes data at the back-end (it's an extract from a
far larger record).

Does anyone know of any resources or reference material that I can get
hold of that illustrates anything like this?

Many thanks,

Paul Harper.

--
A .sig is all well and good, but it's no substitute for a personality

JMS: "SFX is a fairly useless publication on just about every imaginable front.
Never have so many jumped-up fanboys done so little, with so much, for so long."



Mon, 01 Aug 2005 23:44:16 GMT  
 Creating & managing a Visio diagram by VBA
Paul:

You might start by looking at the org chart wizard. If you can get your
extract into suitable format, that might be the way to go, at least for
starters.

Beyond that, not sure how much of a start you need, but I'd break it down
like this:

-- You may have a preference for development environment, but let's assume
VBA for simplicity here.

-- I'll assume you are savvy on how to read the records in -- if not see ADO
or DAO which can be referenced from VBA and used very easily to iterate
through records and read field values. (Or maybe you have a text extract, so
you'll need to read and parse lines of text).

-- For each record, place a rectangle shape on the page (or compose your own
fancier shapes beforehand, place on stencil, and later place those on page).
Position shape according to relationship of this record to boss.

-- Attending to a record's "ReportsTo" field, place a connector and glue it
from employee to boss.

These simple operations, are documented quite nicely in Developing Visio
Solutions at:

msdn.microsoft.com/library/en-us/devref/HTML/DVS_00_Preface_540.asp

You may want your code to calculate the layout, or you might use the
Page.Layout function, which works in conjunction with some page and
connector settings to achieve various effects including hierarchy.

Hope that helps,

Graham

-----------------------------------------
Graham Wideman
Visio 2002 Developer's Survival Pack
diagramantics.com

Quote:
> Hi,

> I am attempting to use OLE to create a new organisation chart-type
> diagram using Lotus Notes data at the back-end (it's an extract from a
> far larger record).

> Does anyone know of any resources or reference material that I can get
> hold of that illustrates anything like this?

> Many thanks,

> Paul Harper.

> --
> A .sig is all well and good, but it's no substitute for a personality

> JMS: "SFX is a fairly useless publication on just about every imaginable
front.
> Never have so many jumped-up fanboys done so little, with so much, for so

long."


Tue, 02 Aug 2005 17:30:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. visio diagram to XML / creating textfiles with VBA in Visio

2. Help - How do I create dynamic Visio diagrams?

3. Creating and Editing UML Diagrams from VBA

4. creating a macro which manages VBA editor itself

5. VBA created menu in Visio 2002 is inactive?!

6. Coding VBA in a MS Word Object created in a Visio document

7. Complete Project Visio Diagram

8. Dynamic Visio Diagrams

9. Access Visio Diagram

10. Visio E/R source diagram from TXT o CSV files

11. Automatic Diagramming and Visio?

12. Filename of linked ole object in visio diagram?

 

 
Powered by phpBB® Forum Software