Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
warrentk80
Creator
Creator

format text by code

Hello to all

I need to change the formatting of text in a text field (font, size, and bold) when a button is clicked.

as you format text by code?

thanks

Andrea

2 Replies
Anonymous
Not applicable

Here is a macro example from APIGiude, it applies font to the active sheet:

sub Font

rem set active sheet to Arial 14 bold

set sp = ActiveDocument.ActiveSheet.GetProperties

set sfont = sp.SheetFont

sfont.FontName = "Arial"

sfont.Bold = true

sfont.Italic = false

sfont.Underline = false

sfont.PointSize1000 = 14000

ActiveDocument.ActiveSheet.SetFont sfont

end sub

Clever_Anjos
Employee
Employee

You can do it using macros.

PFA

sub IncreaseFont

  set obj = ActiveDocument.GetSheetObject("CH01")

  set fnt = obj.GetFrameDef.Font

  fnt.PointSize1000 = fnt.PointSize1000 + 1000

  fnt.Bold = true

  fnt.Italic = true

  fnt.Underline = true

  obj.SetFont fnt

end sub