I have also found that, sometimes, the MSGBox doesn't get focus when
you want it to.
It does seem to help if you specify a title, and if the WindowMaximizer
script is running.
Here is info on the MSGBox, which shows all of the options-
you may have this already.
Jeff Weiss
' MsgBox Function
' Displays a message in a dialog box, waits for the user to click a
button, and
' returns a value indicating which button the user clicked.
Return = MsgBox("MyPrompt", 4161, "MyTitle")
If Return = 1 Then
Result = "the OK button was pressed, and this button has a value of " &
Return
Else
Result = "The cancel button was pressed, and this button has a value of
" & Return
End If
MsgBox Result, , "Title"
' add 1, 64, 0, and 4096
' MsgBox(prompt[, buttons][, title][, helpfile, context])
' prompt String expression displayed as the message in the dialog box.
' buttons Numeric expression that is the sum of values specifying the
number and type of
' buttons to display, the icon style to use, the identity of the default
button,
' and the modality of the message box.
' title String expression displayed in the title bar of the dialog box.
' helpfile String expression that identifies Help file to use to provide
context-sensitive Help
' context Numeric expression identifies the Help context number assigned
by Help author
' The buttons argument settings are:
' Constant Value Description
' vbOKOnly 0 Display OK button only.
' vbOKCancel 1 Display OK and Cancel buttons.
' vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons.
' vbYesNoCancel 3 Display Yes, No, and Cancel buttons.
' vbYesNo 4 Display Yes and No buttons.
' vbRetryCancel 5 Display Retry and Cancel buttons.
' vbCritical 16 Display Critical Message icon.
' vbQuestion 32 Display Warning Query icon.
' vbExclamation 48 Display Warning Message icon.
' vbInformation 64 Display Information Message icon.
' vbDefaultButton1 0 First button is default.
' vbDefaultButton2 256 Second button is default.
' vbDefaultButton3 512 Third button is default.
' vbDefaultButton4 768 Fourth button is default.
' vbApplicationModal 0 Application modal; the user must respond to the
' message box before continuing work in the current application.
' vbSystemModal 4096 System modal; all applications are suspended until
the
' user responds to the message box.
' The first group of values (05) describes the number and type of
buttons displayed in the dialog box;
' the second group (16, 32, 48, 64) describes the icon style;
' the third group (0, 256, 512, 768) determines which button is the
default; and
' the fourth group (0, 4096) determines the modality of the message box.
' When adding numbers to create a final value for the argument buttons,
use only one number from each group.
' Return Values
' The MsgBox function has the following return values:
' Constant Value Button
' vbOK 1 OK
' vbCancel 2 Cancel
' vbAbort 3 Abort
' vbRetry 4 Retry
' vbIgnore 5 Ignore
' vbYes 6 Yes
' vbNo 7 No
From: RicksPlace [mailto:[email protected]]
Sent: Wednesday, April 27, 2011 5:51 AM
To: [email protected]
Subject: MsgBox VBS Function under WE
Hi: I am trying to display a standard MsgBox from my script if a message
is needed while editing a document in WordPad. The message ping comes up
but I have to alt tab to get to the message and the related ok button. I
am trying to use
The format:
Ret = MsgBox( "My Message",4096,"MyTitle" )
So, even with the 4096 specified to indicate this should be on top of
any other windows, I think that is what it does, it still is behind the
WordPad Window when it pops up.
Is there something I am doing wrong or do I need to go to the WindowEyes
Custom MessageBox or what can i do to get a message to pop up on top of
all other windows to be read as a warning or error?
Thanks:
Rick USA