gw_logo_08.gif (1982 bytes) 
Last edit: 05-03-17 Graham Wideman

Visio + Delphi

Visio Automation Controller Using Delphi
Article created: 99-02-01
99-10-29: Delphi 5 Update: Don't proceed until you check out Delphi 5's somewhat more advanced COM Automation wrapper features. These are discussed in the D5 Developer Manual.  When Delphi imports a type library, it now wraps the Events as well, making event handling as easy as in Visual Basic.  This means that you don't need the utility from Binh Ly that's discussed herein if you go that route.  However, the Delphi event wrapper still doesn't solve the issue of hooking up events that Visio only supplies via AddAdvise... so the following article and code may still be useful.

Introduction

It seems that controlling Visio via OLE Automation from Delphi is a frequent topic on Visio's discussion groups, and often a source of some confusion. Several historical reasons have played a part in this:

So, herewith a Delphi unit that takes care of the tricky bits, and a demo of how to do it, event-handling included.

FolderPlus_Blue.gif (384 bytes) Initial Design Decisions
  VSL versus Stand-Alone controller
  Interface methods
  Event-handling methods
FolderOpen_Grey.gif (296 bytes) The Demo and Library Code
FolderPlus_Blue.gif (384 bytes) Download GWVisioDelphi.zip   (includes these pages)
FolderPlus_Blue.gif (384 bytes) Installation and Operation and screen shot
FolderPlus_Blue.gif (384 bytes) Code Structure:  Basic Visio Controller Functionality
FolderPlus_Blue.gif (384 bytes) Code Structure: Event Handling
FolderPlus_Blue.gif (384 bytes) Code Structure: Other Features

Go to:  gw_logo_08.gif (1982 bytes) Up to: [Visio]