Share via


DataDOMEvent.ReturnMessage property

Gets or sets the error message that will be returned if the data validation event is not successful.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
Property ReturnMessage As String
    Get
    Set
'Usage
Dim instance As DataDOMEvent
Dim value As String

value = instance.ReturnMessage

instance.ReturnMessage = value
string ReturnMessage { get; set; }

Property value

Type: System.String

Remarks

Used in conjunction with the ReturnStatus property, the ReturnMessage property displays a message box to the user with the specified text message.

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 ReturnMessage property of the DataDOMEventObject object is used to display a message to the user if the data validation for the XML DOM node fails:

public void qtty_OnBeforeChange(DataDOMEvent e)
 {
  if (e.NewValue.ToString() == "")
  {
   e.ReturnMessage = "You must supply a value for this field.";
   e.ReturnStatus = false;
   return;
  }
}

See also

Reference

DataDOMEvent interface

DataDOMEvent members

Microsoft.Office.Interop.InfoPath.SemiTrust namespace