Discussion:
From Color to Hex
Tristan
2007-01-13 01:43:39 UTC
Permalink
Is there any way that I can get the hex value of a color then pass it
into a string?
Terry Ford
2007-01-13 02:00:47 UTC
Permalink
Post by Tristan
Is there any way that I can get the hex value of a color then pass
it into a string?
The easiest way I know is to use a Variant to convert it for you.


Dim s As String
Dim c As Color=&cFF00FF
Dim v As Variant
v=c
s=v

s should now contain "&hFF00FF"

Terry
Carlos M
2007-01-13 02:19:09 UTC
Permalink
Post by Terry Ford
Post by Tristan
Is there any way that I can get the hex value of a color then pass
it into a string?
The easiest way I know is to use a Variant to convert it for you.
Dim s As String
Dim c As Color=&cFF00FF
Dim v As Variant
v=c
s=v
s should now contain "&hFF00FF"
Or just using CStr:
Dim s As String
Dim c As Color=&cFF00FF
s = CStr(c)

Carlos
Tristan
2007-01-13 03:28:19 UTC
Permalink
Thank you all. Will use Cstr.
Post by Terry Ford
Post by Terry Ford
Post by Tristan
Is there any way that I can get the hex value of a color then pass
it into a string?
The easiest way I know is to use a Variant to convert it for you.
Dim s As String
Dim c As Color=&cFF00FF
Dim v As Variant
v=c
s=v
s should now contain "&hFF00FF"
Dim s As String
Dim c As Color=&cFF00FF
s = CStr(c)
Carlos
_______________________________________________
<http://www.realsoftware.com/support/listmanager/>
<http://support.realsoftware.com/listarchives/lists.html>
Loading...