var
spDisp: IDispatch;
IE1: IWebBrowser2;
IDoc1: IHTMLDocument2;
begin
spDisp:=webbrowser.Application;
try
spDisp.QueryInterface( iWebBrowser2, IE1 );
if IE1 <> nil then
begin
IE1.Document.QueryInterface(IHTMLDocument2,iDoc1);
if iDoc1 <> nil then
begin
if IDOC1.title='该页无法显示' then
showmessage('error')
else showmessage('right');
end;
end;
except
end;
end;