var
doc: IHTMLDocument2;
all: IHTMLElementCollection;
item: OleVariant;
len, i: integer;
begin
doc := wb.Document as IHTMLDocument2;
all := doc.Get_links; //doc.Links亦可
len := all.length;
for i := 0 to len - 1 do
begin
item := all.item(i, varempty); //EmpryParam亦可
listitem := OpenAllLinkForm.ListView_link.Items.Add;
listitem.Caption := item.href;
listitem.SubItems.Add(item.innertext);
end;
end; end;