MsgBox Method (Dialog Object)

Displays a simple dialog box containing a message, one or more push buttons, and an optional icon. Note: The ProgressDialog object also possesses a MsgBox function.

return_value = object.MsgBox text, caption, flags
 

Arguments

object

Required.  A variable containing a dialog object created by calling CreateObject or new ActiveXControl.

text

Required. The message to display in the dialog box.

caption

Optional. The title to display in the title bar of the dialog box.

flags

Optional. Integer that determines the icon and the buttons to be displayed in the message dialog box. For more information, see the description of the Buttons parameter at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctmsgbox.asp.

return_value

Optional. An integer indicating which button the user pressed to close the message box. For a description of possible values, see the description of the return values at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctmsgbox.asp.

Remarks
If you are coding in VBScript, you should use VBScript's built-in MsgBox function rather than this MsgBox method. For information about the built-in MsgBox function, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctmsgbox.asp.

To use this MsgBox method, you must already have created a dialog object, and you must use the dialog object to invoke MsgBox.

Example
See Buttons in JScript.