Visio 2003 SP2: Problems with RED/GREEN/BLUE-function

U

Udo

Hello,

when I use e. g. the RED(2)-function in a VBA macro, the name of the
function is changed to Red(2) and I get the following error message:

Compile error:
Sub or Function not defined

Code snippet:

Dim lColor As Long
lColor = Red(2)

Any hint?


Thanks and greetings
Udo
 
M

Mark Nelson [MS]

I'm not aware of any Red, Green or Blue function in VBA. These are Visio
Shapesheet functions.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

JuneTheSecond

Red property is a property of Color object, and color object is a member of
Colors.
For example, this macro woulddarken all red color on the document.

Sub test()
Dim Iret As Long
ActiveDocument.Colors(visRed).Red = 150
Iret = ActiveDocument.Colors(visYellow).Green
Debug.Print Iret
End Sub
 
J

JuneTheSecond

Sorry,
Iret = ActiveDocument.Colors(visYellow).Green
should be written as
Iret = ActiveDocument.Colors(visRed).Red
 

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