XMLNode.ValidationErrorText property (Word)
Returns a String that represents the description for a validation error on an XMLNode object.
Syntax
expression. ValidationErrorText
( _Advanced_
)
expression A variable that represents a 'XMLNode' object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Advanced | Optional | Boolean | Indicates that the error text displayed is the advanced version of the validation error description, which comes from the MSXML 5.0 component included with Microsoft Word. |
Example
The following example checks each element in the active document and displays a message containing the elements and attributes that don't validate according to the schema and a description of why.
Dim objNode As XMLNode
Dim strValid As String
For Each objNode In ActiveDocument.XMLNodes
objNode.Validate
If objNode.ValidationStatus <> wdXMLValidationStatusOK Then
strValid = strValid & objNode.BaseName & vbTab & _
objNode.ValidationErrorText & vbCrLf
End If
Next
MsgBox "The following elements don't validate against " & _
"the schema." & vbCrLf & vbCrLf & strValid & vbCrLf & _
"You should fix these elements before continuing."
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for