Share via


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.String

    Sets the title of the alert.

  • ald
    Type: Microsoft.Office.Core.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.

  • varfSysAlert
    Type: System.Boolean

    True 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

See Also

Reference

Assistant Interface

Assistant Members

Microsoft.Office.Core Namespace