When you call the MsgBox function, you can use the MsgBoxStyle enumeration in your code in place of the actual values.
The Buttons argument takes the following MsgBoxStyle enumeration members:
Member | Constant | Description |
---|---|---|
OKOnly | vbOKOnly | OK button only (default). |
OKCancel | vbOKCancel | OK and Cancel buttons. |
AbortRetryIgnore | vbAbortRetryIgnore | Abort, Retry, and Ignore buttons. |
YesNoCancel | vbYesNoCancel | Yes, No, and Cancel buttons. |
YesNo | vbYesNo | Yes and No buttons. |
RetryCancel | vbRetryCancel | Retry and Cancel buttons. |
Critical | vbCritical | Critical message. |
Question | vbQuestion | Warning query. |
Exclamation | vbExclamation | Warning message. |
Information | vbInformation | Information message. |
DefaultButton1 | vbDefaultButton1 | First button is default (default). |
DefaultButton2 | vbDefaultButton2 | Second button is default. |
DefaultButton3 | vbDefaultButton3 | Third button is default. |
ApplicationModal | vbApplicationModal | Application modal message box (default). |
SystemModal | vbSystemModal | System modal message box. |
MsgBoxSetForeground | vbMsgBoxSetForeground | Foreground message box window. |
MsgBoxRight | vbMsgBoxRight | Right-aligned text. |
MsgBoxRtlReading | vbMsgBoxRtlReading | Right-to-left reading text (Hebrew and Arabic systems). |
MsgBoxHelp | vbMsgBoxHelp | Help text. |