Hi,
I don't think you need to do anything more than to call procedure EditHyperlink(linktext: string = ''). 'linktext' is only used when no text is selected, if it is, it is wrapped into the hyperlink tags.
WPRichText1.EditHyperlink('link'); WPRichText1.SetFocus;
This is the implementation of 'EditHyperlink'
function TWPCustomRichText.EditHyperlink(linktext: string = ''): Boolean;
var obj : TWPTextObj;
s : string;
begin
obj := HyperlinkAtCP;
if obj<>nil then s := obj.Source
else s := '';
if InputQuery('Hyperlink','URL',s) then
begin
if obj<>nil then obj.Source := s
else if IsSelected then
InputHyperlink(s)
else InputHyperlink(linktext,s);
Result := TRUE;
end else
Result := FALSE;
end;
Regards,
Julian
BTW: The hyperlinks in version 5 work completely different to the hyperlinks in WPTools 4 (were they were created with double underlined and hidden text).
In V5 they consist of a start> and an end tag, similar to HTML, both represented by a TWPTextObj. You can make this tags visible suing a property in the FormatOptions!
This properties of the TWPTextObj are used:
Source = href
Name = title
ObjType - must be wpobjHyperlink!