trichview.com

trichview.support




Re: Insert Paragraph at the beginning of a document


Return to index


Author

Message

Sergey Tkachenko

Posted: 03/19/2004 13:49:40


Use this procedure:


procedure InsertFirstParagraph(rve: TCustomRichViewEdit; ParaNo: Integer);

begin

  rve.BeginUndoGroup(rvutInsert);

  rve.SetUndoGroupMode(True);

  rve.SetSelectionBounds(0, rve.GetOffsBeforeItem(0), 0,

rve.GetOffsBeforeItem(0));

  rve.InsertText(#13);

  rve.SetSelectionBounds(0, rve.GetOffsBeforeItem(0), 0,

rve.GetOffsBeforeItem(0));

  rve.ApplyParaStyle(ParaNo);

  if rve.GetItemStyle(0)=rvsListMarker then

    rve.RemoveLists(False);

  rve.SetUndoGroupMode(False);

end;



>

> Can anyone tell me, how to insert a Paragraph with defined ParagraphFormat

> at the beginning of the document.

> I try following:

>

> RichViewEdit1.SetSelectionBounds(0, RVE.GetOffsBeforeItem(0),0,

RVE.GetOffsAfterItem(0));

> RichViewEdit1.InsertText(#13,True);

> ci := RVE.GetItem(0);

> ci.ParaNo := 0;

> RVE.Format;

>

> Now if a numbered Paragraph was the first paragraph, then the new

paragraph

> has also autonumbering.

> I need it so that the first paragraph has only the features of definded

ParaNo.

>

> Thank you





Powered by ABC Amber Outlook Express Converter