How to use style templates when creating document

General TRichView support forum. Please post your questions here
Post Reply
wsigmund
Posts: 5
Joined: Wed Jun 07, 2017 7:59 am

How to use style templates when creating document

Post by wsigmund »

The advice in the help file is to use style templates rather than text styles and para styles. I need some help with this when generating a document in code. The demo style templates project loads styles from a document or changes the styles at runtime so is not any help. Is there any simple code example to show how you can set up text and para formats (don't want to use the word 'style' here) for a simple text document with a header using style templates? And how the style template relates to parastyle and textstyle?

Or do style templates only apply to editing a document?

Thanks.

William
Sergey Tkachenko
Site Admin
Posts: 17561
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to use style templates when creating document

Post by Sergey Tkachenko »

StyleTemplates do not replace TextStyles and ParaStyles, they are applied on top of them.
Document still refers to items in TextStyles and ParaStyles, but items in TextStyles and ParaStyles can be linked to StyleTemplates.

StyleTemplates do not affect document appearance directly, they are rather provide a mechanism for convenient modification of TextStyles and ParaStyles. Similarly, MS Word's styles do not affect document appearance directly, but they allow changing text and paragraph attributes.
See http://www.trichview.com/help/styles_an ... lates.html

I'll create an example tomorrow.
wsigmund
Posts: 5
Joined: Wed Jun 07, 2017 7:59 am

Re: How to use style templates when creating document

Post by wsigmund »

Thank you Sergey.
edwinyzh
Posts: 104
Joined: Sun Jun 05, 2022 2:22 pm

Re: How to use style templates when creating document

Post by edwinyzh »

Sergey Tkachenko wrote: Sat Jul 08, 2017 9:53 pm StyleTemplates do not replace TextStyles and ParaStyles, they are applied on top of them.
Document still refers to items in TextStyles and ParaStyles, but items in TextStyles and ParaStyles can be linked to StyleTemplates.

StyleTemplates do not affect document appearance directly, they are rather provide a mechanism for convenient modification of TextStyles and ParaStyles. Similarly, MS Word's styles do not affect document appearance directly, but they allow changing text and paragraph attributes.
See http://www.trichview.com/help/styles_an ... lates.html
This, the best description of the purpose of style templates!
Post Reply