Displays a message to the user.
Constant | Value | Description |
---|---|---|
VbOK | 1 | OK button was clicked. |
VbCancel | 2 | Cancel button was clicked. |
VbAbort | 3 | Abort button was clicked. |
VbRetry | 4 | Retry button was clicked. |
VbIgnore | 5 | Ignore button was clicked. |
VbYes | 6 | Yes button was clicked. |
VbNo | 7 | No button was clicked. |
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 the default. |
VbDefaultButton2 | 256 | Second button is the default. |
VbDefaultButton3 | 512 | Third button in the default. |
VbDefaultButton4 | 768 | Fourth button is the default. |
VvbApplicationModal | 0 | Application modal. The user must respond to the message box before continuing work in the current application. |
VbSystemModal | 4096 | System modal. On Win16 systems, all applications are suspended until the user responds to the message box. On Win32 systems, this constant provides an application modal message box that always remains on top of any other programs you may have running. |
The first group of values (0–5) 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.
' displays an information message box having the OK and Cancel buttons Result = MsgBox( "Press OK to continue or Cancel to quit.", 65 )