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
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.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.

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 Namespace