XMLNode.SetValidationError(WdXMLValidationStatus, Object, Boolean) Method

Definition

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

public void SetValidationError (Microsoft.Office.Interop.Word.WdXMLValidationStatus Status, ref object ErrorText, bool ClearedAutomatically = false);
abstract member SetValidationError : Microsoft.Office.Interop.Word.WdXMLValidationStatus * obj * bool -> unit
Public Sub SetValidationError (Status As WdXMLValidationStatus, Optional ByRef ErrorText As Object, Optional ClearedAutomatically As Boolean = false)

Parameters

Status
WdXMLValidationStatus

Required WdXMLValidationStatus. Specifies whether to set the validation status error text (wdXMLValidationStatusCustom) or to clear the validation status error text (wdXMLValidationStatusOK).

ErrorText
Object

Optional Object. The text displayed to the user. Leave blank when the Status parameter is set to wdXMLValidationStatusOK.

ClearedAutomatically
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.

Applies to