Share via


UI2.Alert method (String)

Displays a message box with a custom text message in a Microsoft Office InfoPath form.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
Sub Alert ( _
    bstrAlertString As String _
)
'Usage
Dim instance As UI2
Dim bstrAlertString As String

instance.Alert(bstrAlertString)
void Alert(
    string bstrAlertString
)

Parameters

Implements

UI.Alert(String)

Remarks

The Alert method displays a simple message box that uses an information icon and an OK button. Only the text in the message box can be customized.

Note

In Visual C# code, carriage returns can be inserted into the text of the custom message by using the standard characters.

Examples

In the following example, the Alert method of the UIObject object is used to display a message box:

thisXDocument.UI.Alert("Custom message text goes here.");

See also

Reference

UI2 interface

UI2 members

Alert overload

Microsoft.Office.Interop.InfoPath namespace