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 » Thu Jul 06, 2017 9:33 pm

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: 13470
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to use style templates when creating document

Post by Sergey Tkachenko » 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

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 » Mon Jul 10, 2017 11:13 am

Thank you Sergey.

Post Reply