trichview.com

trichview.support




Re: How to save the content of a RichView object


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/06/2002 10:31:51


Do you want just to save/load RTF with hypertext links (URLs)?

If so, you need to process two events: OnURLNeeded (for saving hyperlinks)

and OnReadHyperlink (for reading them).

This is because the component does not know how you store hyperlinks

(hyperlinks may be not only URLs, they can execute your own custom

commands).


Assuming that you store target URLs in tags of hypertext items (and

rvoTagsArePChars is in Options).


Saving RTF: rv.SaveRTF(FileName, False);

Loading RTF: rv.LoadRTF(FileName);


Writing hyperlinks:


uses CRVFData;

procedure TForm1.rvURLNeeded(Sender: TCustomRichView; id: Integer;

  var url: String);

var ItemNo: Integer;

    RVData: TCustomRVFormattedData;

begin

  Sender.GetJumpPointLocation(id, RVData, ItemNo);

  url := PChar(RVData.GetItemTag(ItemNo));

end;


Reading hyperlinks:

procedure TForm1.rvReadHyperlink(Sender: TCustomRichView; const Target,

  Extras: String; DocFormat: TRVLoadFormat; var StyleNo, ItemTag: Integer;

  var ItemName: String);

begin

  ItemTag := Integer(StrNew(PChar(Target)));

end;


You can see all these things in the demo for MS Office Converters:

Demos\Delphi\OfficeConverters\


> I have a very simple question. How can I save the content of my RichView

> component as an RTF file and then retreive it while the links still work ?

>

> Regards,

>             Geert Vos

>

>





Powered by ABC Amber Outlook Express Converter