I'm trying to programmatically set two text styles inside an also programmatically created 4D Write Pro document, but the last style set is the only one assumed for the whole document.
I have created a new 4D Write Pro document (wpDoc), created a range for the whole document ($range), and used "WP Set Attributes" to format the text.
C_OBJECT(wpDoc;$range)
wpDoc:=WP New
$range:=WP Text range(wpDoc;wk start text;wk end text)
// Style 1
WP SET ATTRIBUTES($range;wk font;"DIN-Bold")
WP SET ATTRIBUTES($range;wk font size;"12pt")
WP SET TEXT($range;"Name: ";wk append)
// Style 2
WP SET ATTRIBUTES($range;wk font;"DIN-Regular")
WP SET ATTRIBUTES($range;wk font size;"10pt")
WP SET TEXT($range;[Companies]Name;wk append)
WP PRINT(wpDoc)
it should look like:
Name: Sample Company name
but it shows like:
Name (plain text): Sample Company name (plain text)