VBScript » Constants » MsgBox

Version: 2.0

MsgBox Constants

You may use either the CONSTANT (left column) or the VALUE (center column) in your code and get the same results.

Specifying buttons and icons:

VBOKOnly 0 Show OK button
VBOKCancel 1 Show OK and cancel buttons
VBAbortRetryIgnore 2 Show abort, retry, ignore buttons
VBYesNoCancel 3 Show yes, no cancel buttons
VBYesNo 4 Show yes, no buttons
VBRetryCancel 5 Show retry, cancel buttons
VBCritical 16 Show critical message icon
VBQuestion 32 Show warning query button
VBExclamation 48 Show warning message icon
VBInformation 64 Show 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

Message box response modality:

VBApplicationModal 0 Current application will not continue until user responds to message box
VBSystemModal 4098 No application will continue until user responds to message box

Return values identifying which buttons were selected:

VBOK 1 OK Button selected
VBCancel 2 Cancel button selected
VBAbort 3 Abort button selected
VBRetry 4 Retry button selected
VBIgnore 5 Ignore button selected
VBYes 6 Yes button selected
VBNo 7 No button selected

See Also: