Assistant.DoAlert Method
Displays an alert and returns an Integer that indicates which button the user pressed.
Namespace: Microsoft.Office.Core
Assembly: office (in office.dll)
Syntax
'Declaration
Function DoAlert ( _
bstrAlertTitle As String, _
bstrAlertText As String, _
alb As MsoAlertButtonType, _
alc As MsoAlertIconType, _
ald As MsoAlertDefaultType, _
alq As MsoAlertCancelType, _
varfSysAlert As Boolean _
) As Integer
'Usage
Dim instance As Assistant
Dim bstrAlertTitle As String
Dim bstrAlertText As String
Dim alb As MsoAlertButtonType
Dim alc As MsoAlertIconType
Dim ald As MsoAlertDefaultType
Dim alq As MsoAlertCancelType
Dim varfSysAlert As Boolean
Dim returnValue As Integer
returnValue = instance.DoAlert(bstrAlertTitle, _
bstrAlertText, alb, alc, ald, alq, _
varfSysAlert)
int DoAlert(
string bstrAlertTitle,
string bstrAlertText,
MsoAlertButtonType alb,
MsoAlertIconType alc,
MsoAlertDefaultType ald,
MsoAlertCancelType alq,
bool varfSysAlert
)
Parameters
bstrAlertTitle
Type: System.StringSets the title of the alert.
bstrAlertText
Type: System.StringSets the text of the alert.
alb
Type: Microsoft.Office.Core.MsoAlertButtonTypeDetermines which buttons are displayed on the alert.
alc
Type: Microsoft.Office.Core.MsoAlertIconTypeDetermines the icon that is displayed on the alert.
ald
Type: Microsoft.Office.Core.MsoAlertDefaultTypeDetermines 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
Type: Microsoft.Office.Core.MsoAlertCancelTypeAlways set this to msoAlertCancelDefault. Any other setting may return an error.
varfSysAlert
Type: System.BooleanTrue if the alert is displayed in a message box or False if the alert is displayed through the Office Assistant.
Return Value
Type: System.Int32