Visual Basic Language Reference  

MsgBoxResult Enumeration

When you call the MsgBox function, you can use the MsgBoxResult enumeration in your code in place of the actual values.

MsgBoxResult Enumeration Members

The MsgBox function returns the following MsgBoxResult enumeration values:

Member Constant Description
OK vbOK OK button was pressed.
Cancel vbCancel Cancel button was pressed.
Abort vbAbort Abort button was pressed.
Retry vbRetry Retry button was pressed.
Ignore vbIgnore Ignore button was pressed.
Yes vbYes Yes button was pressed.
No vbNo No button was pressed.

See Also

Intrinsic Constants and Enumerations | MsgBoxStyle Enumeration | MsgBox Function