We help IT Professionals succeed at work.

Open HTTP page with IE 5.5

pmarkov
pmarkov asked
on
Medium Priority
175 Views
Last Modified: 2010-04-06
I want to open a WWW page with IExplorer 5.5 and show it and close IExplorer in a few minutes fbter the page has been displayed.

How Can I do this?

Thanks.
Comment
Watch Question

Software Developer
CERTIFIED EXPERT
Commented:
Hello

 this will code will open new IE window and show it for 10 seconds, then close the IE window, if you want to increase the time, add that to sleep,

uses comobj;
procedure TForm1.Button1Click(Sender: TObject);
var
  IEApp : Variant;
begin
 IEApp := CreateOLEObject('InternetExplorer.Application');
 IEApp.visible := true;
 IEApp.Navigate('http://www.borland.com/delphi');
 Sleep(10000); // every 1000 = 1 second
 IEApp.quit;
end;

Best regards
Mohammed Nasman

Commented:
Though I'd change the sleep to something like:

var
 start : TTimeStamp;

...

start := dateTimeToTimeStamp(time);
repeat
 application.processMessages;
until dateTimeToTimeStamp(time).time-start.time > 10;

That way your app won't lock up on you waiting for the time to elapse.

GL
Mike

Explore More ContentExplore courses, solutions, and other research materials related to this topic.