Howto update shape text from an access database?

B

Birger

Hi

I am developing a number of process flow charts and am forever changing the text in the process boxes ie. shape numbers as new shapes are added or deleted in the flow charts. Is there a way where it is possible to link the shapes properties - shape text specifically- to a database and then change the shape text from within the database which then dynamically will update the visio drawing

Thanks

Birger
 
C

Chris Roth

There is a DataBase Wizard tool that allows you to link custom properties
and other attributes of a shape to a database. There are various options for
how and when the shapes get updated. Check under: Tools > Visio Extras >
Database wizard.

Furthermore, you can write automation code (in VBA, VB, VB.NET, C#, C++) to
manipulate Visio, extract data from databases, shove it into shapes, etc. A
simple snippte of VBA code might look something like this:

Dim iNum as integer
Dim shpGuid as string

' Perhaps the shape stores some sort of key to the data base in a custom
property cell:
shpGuid = Shape.Cells("Prop.Guid").ResultStr( visNoCast )

' Use that key to get the current shape number from the database:
iNum = getStuffOutOfDatabase( shpGuid )

' Set the custom property for the shape number:
Shape.Cells("Prop.Number").ResultIU = iNum

' You could then link the shape text to Prop.Number using Insert >
Field...

--

Hope this helps,

Chris Roth
Visio MVP


Birger said:
Hi,

I am developing a number of process flow charts and am forever changing
the text in the process boxes ie. shape numbers as new shapes are added or
deleted in the flow charts. Is there a way where it is possible to link the
shapes properties - shape text specifically- to a database and then change
the shape text from within the database which then dynamically will update
the visio drawing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top