Several things you could do:
* Rather than firing up IE, use a webbrowser control on an Access
form. Very elegant, and you have lots of control over what gets
displayed and what the user can do.
* When starting IE, do it in such a way (perhaps: CreateProcess) you
get an instance (module?) handle that you can later use to close it.
Knowledge of Windows APIs helps.
* You could use Windows APIs to enumerate all main windows (or,
perhaps, use FindFindow), get the window handle, inspect the titles
and/or other properties, and send a WM_CLOSE message to the one you
want to close.
I like option 1.
-Tom.
>Hello all,
>I have made a button in access which opens iexplore and directs it to a
[quoted text clipped - 4 lines]
>Many thanks,
>Ronny
Ronny Sigo - 02 Sep 2004 07:35 GMT
Hello Tom,
Thank you for responding. The problem is that my skills as a programmer are
elevated enough to fool around in visual basic, but I never got to learn
about API's (not that I don't wan to, but time is an issue) This opening an
closing of IE, however has become a very urgent matter for me. This opening
an closing must be done without intervienience of the user. So what I would
need is an piece of code that I could use to perform both actions ... Would
you know where I could find this?
Many thanks in any case !
Ronny
> Several things you could do:
> * Rather than firing up IE, use a webbrowser control on an Access
[quoted text clipped - 20 lines]
> >Many thanks,
> >Ronny
Tom van Stiphout - 02 Sep 2004 15:00 GMT
This page:
http://www.mvps.org/access/api/api0004.htm
has most of the code you'll need.
I'm assuming you have a Open IE and a Close IE button. The first would
get all this code without the WaitForSingleObject and CloseHandle
lines, whereas the latter would get the CloseHandle line. Note that
proc should be a form-level global variable.
-Tom.
>Hello Tom,
>Thank you for responding. The problem is that my skills as a programmer are
[quoted text clipped - 32 lines]
>> >Many thanks,
>> >Ronny