Property for the complete Hypertext

General TRichView support forum. Please post your questions here
Post Reply
BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

Property for the complete Hypertext

Post by BernhardRoos »

Hello,
is there a property or method where I can get the complete Hypertext as String?
Best wishes
Bernhard
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you want to read hyperlink target?
In TRichView, hypertext targets are usually stored in item tags. In order to store strings in tags, include rvoTagsArePChars in RichViewEdit.Options.
Then use GetItemTag method. It returns integer, convert it to PChar and assign to string. For example

Code: Select all

procedure TForm1.RichViewEdit1Jump(Sender: TObject; id: Integer);
var URL: String;
    RVData: TCustomRVFormattedData;
    ItemNo: Integer;
begin
  RichViewEdit1.GetJumpPointLocation(id, RVData, ItemNo);
  URL := PChar(RVData.GetItemTag(ItemNo));
  ShellExecute(0, 'open', PChar(URL), nil, nil, SW_SHOW);
end;
BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

Post by BernhardRoos »

Thanks for your answer.
But I have to write a routine where I can replace placeholders (Fields) with Values at runtime. So I must iterate each item (including tables, text items, etc.) looking for placeholder (placeholders are beginning with < and ending with > for example <mitarbeiterstamm.nummer>, at runtime it should replace with the value of the field.).
How I can iterate through normal items (text items), I know. But I do not know how can I change the text within tables programmatically.
Best wishes
Bernhard
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

Post by BernhardRoos »

Thanks for the link. I will look into this topic.
Post Reply