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
bstrAlertString
Type: System.StringThe text to be displayed.
Implements
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.");