Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continue on with code AFTER window is closed.

Status
Not open for further replies.

markronz

IS-IT--Management
Mar 20, 2007
93
US
Hello I am writing a VBScript file. Essentially it will display some information in a explorer window. After the user clicks the X in the upper right corner to close the window, I would like the program to continue and perform more actions. But I only want the program to continue AFTER they close the window.

Here is just a bit of my code:

Set objExplorer = Wscript.CreateObject("InternetExplorer.Application")
objExplorer.Document.Body.InnerHTML = txt + "<p>Assist Complete. <i>(You may now close this window.)</i>"

So after they close this objExplorer window I want it to continue. Any ideas?
 
I haven't played with the IE object all that much, but the following worked for me.


Code:
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Visible = True
objExplorer.ToolBar = False
objExplorer.StatusBar = False
objExplorer.Navigate "about:blank"
objExplorer.Document.Body.InnerHTML = "<p>Assist Complete. <i>(You may now close this window.)</i>"

Do While TypeName(objExplorer) = "IWebBrowser2"
	WScript.Sleep 1000
Loop

WScript.Echo "Window closed...proceed with script"

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Thanks! It worked great! Not sure I know exactly what it's doing, but it works and thats all that matters at the moment!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top