Page 1 of 1

Property for the complete Hypertext

Posted: Thu Nov 29, 2007 11:02 am
by BernhardRoos
Hello,
is there a property or method where I can get the complete Hypertext as String?
Best wishes
Bernhard

Posted: Thu Nov 29, 2007 11:12 am
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;

Posted: Thu Nov 29, 2007 1:41 pm
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

Posted: Thu Nov 29, 2007 1:54 pm
by Sergey Tkachenko

Posted: Fri Nov 30, 2007 6:45 am
by BernhardRoos
Thanks for the link. I will look into this topic.