Extra /par when loading RTF file

General TRichView support forum. Please post your questions here
Post Reply
GWIS
Posts: 14
Joined: Mon Dec 12, 2005 12:05 am
Location: Australia

Extra /par when loading RTF file

Post 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.
GWIS
Posts: 14
Joined: Mon Dec 12, 2005 12:05 am
Location: Australia

Post 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
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
GWIS
Posts: 14
Joined: Mon Dec 12, 2005 12:05 am
Location: Australia

Post by GWIS »

Thanks Sergey. I was calling clear but my mistake was to also call Format after clearing but before loading the rtf file.
Post Reply