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)

Usage

Dim Status As WdXMLValidationStatus
Dim ErrorText As Object
Dim ClearedAutomatically As Boolean
Dim xMLNode1 As XMLNode
xMLNode1.SetValidationError(Status, ErrorText, ClearedAutomatically)

Syntax

Sub SetValidationError( _
    <InAttribute()> ByVal Status As WdXMLValidationStatus, _
    <InAttribute()> Optional ByRef ErrorText As Object, _
    <InAttribute()> Optional ByVal ClearedAutomatically As Boolean _
)
void SetValidationError(
    [In] WdXMLValidationStatus Status, 
    [In, Optional] ref object ErrorText, 
    [In, Optional] bool ClearedAutomatically
);
public: Void SetValidationError(
    WdXMLValidationStatus^ Status, 
    &Object^ ErrorText, 
    Boolean ClearedAutomatically
);
public void SetValidationError(
    /*in*/WdXMLValidationStatus Status, 
    /*in*/System.Object ErrorText, 
    /*in*/boolean ClearedAutomatically
);
function SetValidationError(
     Status : WdXMLValidationStatus, 
     ErrorText : Object, 
     ClearedAutomatically : Boolean
);

Parameters

  • Status
    Required WdXMLValidationStatus. Specifies whether to set the validation status error text (wdXMLValidationStatusCustom) or to clear the validation status error text (wdXMLValidationStatusOK).
  • ErrorText
    Optional Object. The text displayed to the user. Leave blank when the Status parameter is set to wdXMLValidationStatusOK.
  • ClearedAutomatically
    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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

XMLNode Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

XMLNode Members