Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change the font color of a textbox with a macro

Hello,

It looks like it's quite easy to change the size of type of font of a textbox with a macro, but I have not been able to change the color. Anyone is able to please help?

thanks!

4 Replies
NickHoff
Specialist
Specialist

Use an expression with the name of the field(red), field(black), or you can do field(RGB)255,255,255))

Not applicable
Author

Hi,

I'm trying to set the color of the font with a macro, not an expression though.

NickHoff
Specialist
Specialist

Set gp = Text.GetProperties

Set cp = Text.TextProperties

gp.Expressions.Item(0).Item(0).TextColor.PrimaryCol.Col = RGB(255,255,255)

Also, another work around you could have a text box hidden behind the other and do a show/hide off the button.

Not applicable
Author

Here is the code (not working):

set Text=activedocument.getsheetobject("TX284")

Set gp = Text.GetProperties

Set cp = Text.TextProperties

cp.Expressions.Item(0).Item(0).TextColor.PrimaryCol.Col = RGB(255,255,255)

mybox.setproperties gp

end sub

The goal is to change the font of a textbox to a given color. Any help to make the code work? thanks!