Scan editor for link occurence

  • Hi,

    In my editor I add a mailto: link.
    Is the a way to check if there is already such a link present with combination of mailto: and UNSUBSCRIBE?

    • Offizieller Beitrag

    It should work like this:

    Code
    i : Integer;
        aList : TWPTextObjList ;
    begin
        aList := TWPTextObjList.Create;
        WPRichText1.TextObjectsGetList(aList, wpobjHyperlink, false);
        for i := 0 to aList.Count-1 do
        begin
           if Pos('mailto:', aList.Items[i].Source)>0 then ShowMessage('We have a mail to');
        end;
        aList.Free;

    But this only works if - sorry for the bug - LoopObjectsB is used by TextObjectsGetList. Will be fixed in next release.