Assistant.DoAlert Method
Note
|
|---|
| The Microsoft Office Assistant has been deprecated in the release of the Microsoft Office system. |
Syntax
expression.DoAlert(bstrAlertTitle, bstrAlertText, alb, alc, ald, alq, varfSysAlert)
expression A variable that represents an Assistant object.
Parameters
| Name | Required/Optional | Data Type | Description |
|---|---|---|---|
| bstrAlertTitle | Required | String | Sets the title of the alert. |
| bstrAlertText | Required | String | Sets the text of the alert. |
| alb | Required | MsoAlertButtonType | Determines which buttons are displayed on the alert. |
| alc | Required | MsoAlertIconType | Determines the icon that is displayed on the alert. |
| ald | Required | MsoAlertDefaultType | Determines which button is set as the default button of the alert. If this argument is set to a value greater than the number of buttons, an error is returned. |
| alq | Required | MsoAlertCancelType | Always set this to msoAlertCancelDefault. Any other setting may return an error. |
| varfSysAlert | Required | Boolean | Is True if the alert is displayed in a message box or False if the alert is displayed through the Office Assistant. |
Return Value
Integer
Remarks
The return values of the DoAlert method corresponds to the values of the vbMsgBoxResult enumerated type (for example, vbYes, vbNo, or vbCancel). In addition to these values, the following values may also be returned:
- "Yes to all" = 8
- "Try again" = 10
- "Continue" = 11
Example
The following example displays an alert through the Office Assistant and displays a message box indicating which button the user pressed. If the assistant is disabled, the alert is displayed in a normal message box.
| Visual Basic for Applications |
|---|
|
Note