Page 1 of 1

Extra /par when loading RTF file

Posted: Mon Nov 07, 2011 9:50 pm
by GWIS
When loading an rtf file used as a template for creating other documents, there is an extra /par inserted into the text which gives an extra line at the front. If you save the template then reload it another /par is added etc.

Is there a setting to stop this or easy method to remove this immediately after loading the template?

eg ... see the extra /par in the loaded file.

Original file:

\uc1
\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 \plain \f0\fs20 <<INSERTFILE:My_Letterhead>>
\par {\trowd\trgaph98\trleft0\itap1\trpaddl105\trpaddt0\trpaddr105.....

Loaded file:

\uc1
\pard\fi0\li0\ql\ri0\sb0\sa0\itap0 \plain \f0\fs20
\par <<INSERTFILE:My_Letterhead>>
\par {\trowd\trgaph98\trleft0\itap1\trpaddl105\trpaddt0\trpaddr105......

Thanks.

Posted: Mon Nov 07, 2011 11:01 pm
by GWIS
By the way, I can do it by loading the rtf template into a text stream and editing it, then putting it back into Richview, but this seems very cumbersome. Is there a better way?

Thanks

Posted: Tue Nov 08, 2011 6:42 pm
by Sergey Tkachenko
TRichViewEdit initially has one empty text line.
LoadRTF does not clear existing document before loading, it adds to the end.
Call Clear before LoadRTF.

Posted: Tue Nov 08, 2011 8:54 pm
by GWIS
Thanks Sergey. I was calling clear but my mistake was to also call Format after clearing but before loading the rtf file.