o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Controlling the Window Object with vbScript -

I am using the following code snippet to confirm the user wants to close the browser window:

<HEAD><TITLE>A Simple Document></TITLE>
<SCRIPT LANGUAGE="vbScript">
Sub unload()
window.event.returnValue = "Do you really want to quit?"
End Sub
</SCRIPT>
</HEAD>
<body onbeforeunload="unload()">

The code displays a message box upon closing the browser window. It works fine, however, the message box also displays when moving between links within the site. I only want it to display the message box when the user closes the browser window. Also the message box displays three lines of information for the user. I have listed the lines below:

1) The first line says: "Are you sure you want to navigate away from this page?"

2) The second line that's displayed is the message I pass to window.event.returnvalue in the unload subroutine above: "Do you really want to quit?"

3) And the third line says" "Press OK to continue or Cancel to stay on the current page."

So my question is how do I display this confirmation only when the browser window is closing and prevent the message box from displaying when the user is just navigating through links on my site. And how do I alter the text that's displayed on lines 1 and 3 of the message box. I would like to give the user a more specific message, and these lines seem to be hidden behind the window.event

 

New IE Window... please help -
Hello, I am quite new to writing VBscript and just encountered some problem writing my first VBscript at my summer job. Please shed some light on my problem, any help would be appreciated!! I'm trying to write a VBscript that automatically open our website, login, and test the we


Controlling an IE window thats inside AIM -
Does anyone have any clues as to how I might control an IE window thats inside another app? I'm looking to soup up the "AIM Today" window in Instant Messenger. I have the "Internet Explorer_Server" hwnd, whether that is useful or not I do not know. Anyone have an


Get window object from outside the browser -
I am coding automated testing at the moment and need to access the window object of a browser from the test environent. I can get references to the document objects in frames and the document object of the frame but i need to be able to get the window object so i can query it's proper


The 'width' property (VBScript) -
In VBScript, how do you find the width of the current page's window? The window object does not seem to have a width poperty...and I need to set a div's width to 100% - 196px...


Controlling the Window Object with vbScript -
I am using the following code snippet to confirm the user wants to close the browser window: <HEAD><TITLE>A Simple Document></TITLE> <SCRIPT LANGUAGE="vbScript"> Sub unload() window.event.returnValue = "Do you really want to quit?"


Invoke VBScript from VB.NET -
Hi I classic VB6 you can place the script control on a form, load VBScript into it and excecute. You can also share objects between VB6 and VBScript. I want to achieve the same thing but with VB.NET. My objective is to write a VB.NET application that will run some queries against a


Help with Exposing VBScript Objects -
Hi all, I want to write some VBscripts in a HTML page BUT I am sometimes lost as to the objects and the properties and the methods available to me. For example the Document Obect or the Window Object Document.Write Window.Navigate There is no way I can expose the properties


Help Me expose VBScript's Objects and Properties -
Hi all, I want to write some VBscripts in a HTML page BUT I am sometimes lost as to the objects and the properties and the methods available to me. For example the Document Obect or the Window Object Document.Write Window.Navigate There is no way I can expose the proper


IE Object -
Does anyone know how to set object to an already open IE window. If another program opens an IE window, I need to be able to set an object to that IE window through the IE object in order to control it. I already know how to get the hwnd off of the new window but I cannot figure out


sending keystrokes in VBScript -
Does anyone out there know of a command similar to SendKeys in VB for use in VBScript? I am trying to open a Dos window from VBScript code and send it some commands to automate a service. If anyone has any tips, i would appreciate it. Thanks


keep a handle on a window opened with VBScript -
I'm using the window.open function from within a clientside VBScript to open a new window. I'd like the parent window to be able to test whether the child window is still open. So my question is how do you keep a handle on the child window and how do you test if the child window


Calling dll commands and making window app -
What commands can I do to make dll calls todo commands and to make window application? I am some what new to vbscript but since I program in BASIC languages, I know some of the syntax. Can anyone point me to the Window Script tutorial for vbscript?


Can I access the document object in an existing browser window -
Greetings: I need to find a way to access the document object of an instance of a browser that is opened from an other browser (that my VB application is controlling). Any help would be appreciated. Thanks Rick Quisenberry


Active X - Close Problems -
I am writing an activex control that displays a form on top of all others and processes information sent to it by the controlling program. The dll itself has 3 seperate classes that are each created as seperate objects using the vbscript from the application. (Set Obj1 = CreateObject


Calling a VBScript from within a VBScript -
I have a VBScript that needs to call another VBScript and I'm not sure how to do it. The called VBScript also has 3 command line parameters. Any ideas on this? Thanks,


Opening IE in a new window with Folders option turned on (via VBscript or Javascript) -
Does anyone know how to open IE in a new window with the folders options turned on? (via VBScript or JavaScript) Thanks!! Victor.


Switching Focus to controlling calling app -
When using an ActiveX EXE that i wrote it takes focus all the time. It displays a form which shows animations and graphics but has no input other than via vbscript. It initialises but doesn't return focus to the controlling app without clicking on it. Is there a way to stop it eve


vbscript - financial functions! rate() -
Im trying to build a financial calculator in vbscript, and have stumbled upon the fact that vbscript does not support any financial functions? Can anyone confirm this? Is there any other alternatives to rewriting this functions? Specifically i am after the rate() function (the on


Controlling the X in the upper right-hand corner. -
How would one go about controlling this form element? I would like to prompt the user before closing the application. Also, what about capturing ALT-F4? Thanks, Chris


AIM Controlling[resolved] -
Im working on a program that does little things to an AIM window. I can do a lot to the window in general, but now i want to be able to send text to the text box. How do i gain control of the text box?


VB or VBScript -
Hey, posted this over in VBScript also. I am very new to VBScript. I know VB pretty good though, so hopefully this helps. I am trying to use VB or VBScript to open or pass a command line to Monarch Pro to take a report and put it into a template, that is already created, load it to a


How to window.close -
Pls I want to run my vbscript then at the bottom of the script window.close to close the browser window. but am getting the error Variable is undefined: 'window' whats wrong with this???


How do VB for Word, Excel and VBScript work together -
I need help understanding how object models interact with each other. If I open Excel using VBScript, how do I know what objects and methods are available to me. Should I be able to use any and all of the Excel methods in VBScript once I create an Excel object (under appropriate Exce


Going back one page in VBScript -
Hi! I'm looking for a command or a way to go back to the previous page from within VBScript. Sort of the VBScript alternative for "window:history.go(-1)" in JavaScript. If anybody knows, I'd be very grateful. Marcel Boeren m.boeren@Euro-Partners.nl


Dynamically creating a form and control in a VBscript -
I need to create a VBscript which has 1 form, and at least one control. I want to prompt the use to change the drive letter. So I need a form, and a Dir List Box. However, I don't know how to add a form or control to a vbscript, since it seems to be limited to variant data types


javascript -> vbscript -
Can any1 tell me how to do the following. In JavaScript I alsways used: window.onload = init; to execute a funtion on statup. How can I do this in VBscript? I've tried but not succesful so far.... Rick


Using Timer Control via VBScript -
This is the second thread of mine that got stuck. I guess there is a problem with me connection. Anyway, I'm trying to create a timer object instance within VBScript. As you can guess I couldn't. I need to execute a statement say every three seconds and I need to do this via VB


How do VB for Word, Excel and/or VBScript work together -
I need help understanding how object models interact with each other. If I open Excel using VBScript or VB in Word, how do I know what objects and methods are available to me? Should I be able to use any and all of the Excel methods in VBScript/Word once I create an Excel object (un


.net class in vbscript -
I'm trying to run a vbscript on my web server as a cgi. When the script executes, it's supposed to create an instance to an object I created in vb.net. CreateObject can't seem to create the object that I wrote in vb.net Is it possible to create an instance of a .net object in win


Controlling another application -
Okay, here's the problem in a nutshell. Is it possible to have one program running in the background on a PC that will actually output to other applications. I don't believe this can be done, but my boss seems to think it can be. Specifics are: A card swipe is hooked into a ter


ASP and VBScript -
Is it possible to use the Server object in my VBScript? I keep getting an error when I do. Here is what I have: <SCRIPT Language=vbscript RUNAT=Server> Set objComponent = Server.CreateObject ("Test.ProcessInputs") </SCRIPT> Here is the error I get: &quo


Do I need VBScript for this -
I am very new to VBScript. I know VB pretty good though, so hopefully this helps. I am trying to use VB or VBScript to open or pass a command line to Monarch Pro to take a report and put it into a template, that is already created, load it to a certain website, login automatically w/


CMD Window -
Does anyone know how to turn-off the cmd.exe window from flashing when running a vbscript or shell command from vb?


Popup window in VBScript -
I located the following code to create a popup window in VBScript. It's kind of simple I think. Sub cmdTest_Click Set oPopup = Window.createPopup Set oPopBody = oPopup.Document.Body oPopBody.Style.Backgroundcolor = "lightyellow" oPopBody.InnerHTML = "click outs


Controlling the IE window -
How do you control things like which toolbars and menu bars are visible. I've seen web-pages that hide everything except the title bar.


Re: VBScript vs. ASP -
Hello. I am starting to learn ASP and VBScript. Could you please tell me how they are different, how they are related, or whatever in terms of HTML? I know that the tag to start any VBScript (ditto to Javascript) is &lt;SCRIPT LANGUAGE="VBScript"&gt;, and the code f


VBScript Newbie Question (VERY EASY) -
Ok, I'm new to VBScript, so don't laugh. How do I take the VBScript source I made in MSE and create a vbscript file? Do I just copy/paste it and change the extension like I would an HTML file?


How to run a command at cmd line -
I am very new to VB. In VBscript, I am able to run commands (regsvr32.exe /s /c ... regedit -s ... net stop... etc.) in a hidden cmd.exe window using WSH and creating a ("wscript.shell") object and passing whatever the command is to a little sub. How can I run a program li


A somewhat difficult question about VBscript -
Is there any way I could allow VBScript to run under Mozilla and other alternative browsers? I know VBScript only work under Internet Explorer. I wonder is there's any hidden tweak or special program to allow VBScript to be enable in Mozilla? Thanks, Greg


vbscript lost focus routine -
what the heck is the proper syntax for writing a lost focus routine in either vbScript or ASP? I know VB but am new to both vbScript and ASP. I noticed that what is Text1_GotFocus in VB is Text1_OnFocus in vbScript. What is the vbScript equivalent of Text1_LostFocus?