Share via


UI2.Alert Method

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
'Usage

Parameters

  • bstrAlertString
    The text to be displayed.

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.

Example

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
Microsoft.Office.Interop.InfoPath Namespace