- Offizieller Beitrag
Using this code you can create a new paragraph fast and fill it with text and objects. The objects in this case are the start and end tags of a hyperlink.
Code
var par : TParagraph;
start_tag, end_tag : TWPTextObj;
begin
par := WPRichText1.ActiveText.AppendNewPar(false);
par.Append('This is a link: ');
start_tag := par.AppendNewObject(wpobjHyperlink,true,false);
start_tag.Source := 'http://www.wpcubed.com';
par.Append('WPCubed');
end_tag := par.AppendNewObject(wpobjHyperlink,true,true);
// Link both together!
end_tag.SetTag(start_tag.NewTag);
// and dome more text
par.Append(' (click)');
WPRichText1.Refresh();
end;
Alles anzeigen