Table of contents
TOC
Collapse the table of content
Expand the table of content

MsgBox Constants

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

The following constants can be used anywhere in your code in place of the actual values:

MsgBox Arguments

ConstantValueDescription
vbOKOnly0OK button only (default)
vbOKCancel1OK and Cancel buttons
vbAbortRetryIgnore2Abort, Retry, and Ignore buttons
vbYesNoCancel3Yes, No, and Cancel buttons
vbYesNo4Yes and No buttons
vbRetryCancel5Retry and Cancel buttons
vbCritical16Critical message
vbQuestion32Warning query
vbExclamation48Warning message
vbInformation64Information message
vbDefaultButton10First button is default (default)
vbDefaultButton2256Second button is default
vbDefaultButton3512Third button is default
vbDefaultButton4768Fourth button is default
vbApplicationModal0Application modal message box (default)
vbSystemModal4096System modal message box
vbMsgBoxHelpButton16384Adds Help button to the message box
VbMsgBoxSetForeground65536Specifies the message box window as the foreground window
vbMsgBoxRight524288Text is right aligned
vbMsgBoxRtlReading1048576Specifies text should appear as right-to-left reading on Hebrew and Arabic systems

MsgBox Return Values

ConstantValueDescription
vbOK1OK button pressed
vbCancel2Cancel button pressed
vbAbort3Abort button pressed
vbRetry4Retry button pressed
vbIgnore5Ignore button pressed
vbYes6Yes button pressed
vbNo7No button pressed
© 2017 Microsoft