Share via


UI2.Alert method (String)

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

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.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 \n characters.

Important

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

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.SemiTrust namespace