Alert Method

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

expression.Alert(ByVal bstrAlertString As String)

expression Required. An expression that returns a reference to the UI object.

bstrAlertStringRequired String. The text to be displayed.

Security Level

2: 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.

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  Carriage returns can be inserted into the text of the custom message by using the standard \n characters.

Example

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

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

Applies to | UI Object