Some help with styles needed

  • Hi all.

    I'm trying to set styles in code for an edit. I've managed to *almost* set the initial style like this:

    Setting the ActivePar.ABaseStyle seems necessary, otherwise on an empty editor the first paragraph is not using that style, only the following ones.

    Anyway, my problem is that the font is not Times New Roman in the editor. Color is red and the style dropdown correctly shows "Test style" as the selected style, but it is using Arial font.

    Maybe I need to set the DefaultAttr or something like that? Btw, I've noticed that DefaultAttr doesn't work (or probably I don't use it correctly), instead I have to use WritingAttr to affect the defaults.

    Is there a complete sample of something along the lines of setting styles in code and assigning the default one? Lots of pieces of information in the docs and this forum, but I'm still a bit lost...


    TIA,
    Antti Kurenniemi

    • Offizieller Beitrag

    Hi,

    Sorry, I was not able to answer earlier. The problem is that the WritingAttr overrides the color from the style.

    You can use OnEneter to set the style AND clear the writing attribute.