Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

macro to change the font style of an object

Hi

I want a macro that change an object font style from bold to regular and regular to bold

8 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

You can write similar code in macro to acheive the result.

set chart = ActiveDocument.GetSheetObject("CH01")

set p = chart.GetProperties

p.ChartProperties.BlockCaptionFont.Bold = true

chart.SetProperties p

You can view the APIGuide.qvw located in the Qlikview installation folder for more help.
Path :Qlikview\Documentation


Not applicable
Author

ChartProperties not supporting

deepakk
Partner - Specialist III
Partner - Specialist III

HI,

Check if the object id is correct in your case. i.e CH01

Not applicable
Author

Actually I want to change the caption font of a button

deepakk
Partner - Specialist III
Partner - Specialist III

HI,

Try this code.

set obj = ActiveDocument.getsheetobject("BU01")

fnt = obj.GetFrameDef.Font

fnt.PointSize1000 = fnt.PointSize1000 + 1000

obj.SetFont fnt



Not applicable
Author

But I dont want to set the font size

I want to make the font bold

Not applicable
Author

Can you provide the syntaz for changing the font color?

Also, do you know how to use an option other than "Set by Style" on the Font tab of objecet properties.  I am being forced to use it and cannot customized my fonts by object.

Thanks!

Not applicable
Author

This macro works ror me;)

sub Bold

set obj = ActiveDocument.GetSheetObject("BU01")

fnt = obj.GetFrameDef.Font

fnt.Bold = true

obj.SetFont fnt

end sub