MsgBox

Description

Displays a message in a dialog box and waits for the user to choose a button

Syntax

ret = MsgBox (MsgString, type, TitleString)

Parameters

ret

Integer, output

 

Indicates which button the user pressed.

 

1,2,3,4,6,7 = OK, Cancel, Abort, Retry, Yes, No

 

 

MsgString

String, input

 

This is the message displayed in the dialog box.

 

 

type

Integer, input

 

Indicates the number and type of buttons, and other attributes of the dialog box. The value is the sum of the following numbers, one from each group.

 

Group 1 – Number and type of Buttons

 

0 = OK

 

1 = OK/Cancel

 

2 = Abort/Retry/Ignore

 

3 = Yes/No/Cancel

 

4 = Yes/No

 

5 = Retry/Cancel

 

Group 2 – Type of Icon

 

16 = Stop icon

 

32 = Question mark icon

 

48 = Exclamation mark icon

 

64 = Information mark icon

 

Group 3 – Button Default

 

0 = 1st button is default

 

256 = 2nd button is default

 

512 = 3rd button is default

 

Group 4 – Type of Dialog Box

 

0 = Application modal

 

4096 = System modal

 

 

TitleString

String, input

 

The text string that appears as the title of the dialog box.

Remarks

The MsgBox function returns a value indicating which button the user has chosen. Refer to the Microsoft VBScript documentation for additional information.

This is a VBScript function.

Example

Sub ZMain()
TitleString="PASSPORT Macro"
MsgBox "Do you want to Continue?",4,TitleString
End Sub