trichview.com

trichview.support




Re: Saving/Loading RTF with links (problem?)


Return to index


Author

Message

Sergey Tkachenko

Posted: 03/12/2003 23:15:56


You need to process two events

(Assuming that links are stored in tags:)


uses CRVFData;


// saving hyperlinks in RTF and HTML

// event OnURLNeeded

procedure TForm1.RichViewEdit1URLNeeded(Sender: TCustomRichView;

  id: Integer; var url: String);

var RVData: TCustomRVFormattedData;

    ItemNo: Integer;

begin

  RichViewEdit1.GetJumpPointLocation(id, RVData, ItemNo);

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

end;


// importing hyperlinks from RTF

// event OnReadHyperlink

procedure TForm1.RichViewEdit1ReadHyperlink(Sender: TCustomRichView;

  const Target, Extras: String; DocFormat: TRVLoadFormat; var StyleNo,

  ItemTag: Integer; var ItemName: String);

var URL: String;

begin

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

end;



> OK, I am building a RTF document and can use the link correctly (CTRL -

> Click).  I then save the document using SaveRtf().  I then load the

document

> using LoadRTF() but the links don't work after the file is loaded.

> Everything else seems to be OK.  Any insights?

>

> Ken

>

>





Powered by ABC Amber Outlook Express Converter