Share via


XMLNode.SetValidationError Method

Changes the validation error text displayed to a user for a specified node and forces Microsoft Word to report a node as invalid.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Sub SetValidationError ( _
    Status As WdXMLValidationStatus, _
    ByRef ErrorText As Object, _
    ClearedAutomatically As Boolean _
)
'Usage
Dim instance As XMLNode
Dim Status As WdXMLValidationStatus
Dim ErrorText As Object
Dim ClearedAutomatically As Boolean

instance.SetValidationError(Status, ErrorText, _
    ClearedAutomatically)
void SetValidationError(
    WdXMLValidationStatus Status,
    ref Object ErrorText,
    bool ClearedAutomatically
)

Parameters

  • ErrorText
    Type: System.Object%
    Optional Object. The text displayed to the user. Leave blank when the Status parameter is set to wdXMLValidationStatusOK.
  • ClearedAutomatically
    Type: System.Boolean
    Optional Boolean. True automatically clears the error message as soon as the next validation event occurs on the specified node. False requires running the SetValidationError method with a Status parameter of wdXMLValidationStatusOK to clear the custom error text.

See Also

Reference

XMLNode Interface

XMLNode Members

Microsoft.Office.Interop.Word Namespace