How to change a color of a shape when it meets a condition

K

Kate

I'm a computer tech working on a "Site Map"
Currently managing a site with over 350 computers at that site alone...
There are several layers:
layer 1 - Floor Plan....
layer 2 - Computers
and so on....
The computer icons are tied to "Trackit" program that keeps track of
all of our equipment.
The Database is tied to the drawing via a table thru SQL using a ODBC
link...
My question is...there is an "Audit date" property that records the
date of last audit.
I want to be able to change the computer icon from "Green" to "Red"
according to the
condition of the audit date.
Example:
If Audit Date>= 30 days then "Green"
Else "Red"
and so on....

Any suggestion on how to do that...
If it is created in VBA.... where do I begin... and how do I tie it to
the icon itself?
Are there any Free "Online" sites that would help in VBA code for Visio
specific...
The VBA.. .differs quite a bit between MS applications.....
 
T

Tiret Ohf D.

I did it this way:

class VisioPrimitive
{
....
public Color Color
{
set
{
string color = "0"; // black is default for the shape

if (value == Color.Red)
color = "2";
else if (value == Color.Violet)
color = "6";

Shape.get_CellsSRC(visSectionObject,
(short)VisRowIndices.visRowLine,
(short)visCellIndices.visLineColor).FormulaU = color;
}
}
....
}
 
A

Al Edlund

there are two parts to the puzzle. the first is color by value which can
either be done with the existing add-on that is in the (I believe) building
plans stencils, the other example is at John Marshall's site
(www.mvps.org/visio). The second part is the need to on a timed basis kick
off a query of your database values and apply it to the appropriate custom
properties. The timer pop can be as simple as a timer control and there are
examples in msdn (check office developer visio 2000 articles) on how to
query from vba.

al
 

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