UI.Alert Method

InfoPath Developer Reference

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

Version Information
Version Added: InfoPath 2003

Syntax

expression.Alert(bstrAlertString)

expression An expression that returns a UI object.

Parameters

Name Required/Optional Data Type Description
bstrAlertString Required String The text to be displayed.

Return Value
Nothing

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.

Bb229748.vs_note(en-us,office.12).gif Note
Carriage returns can be inserted into the text of the custom message by using the standard
JScript
  \n
characters.
JScript
  \n

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.

Example

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

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

See Also