XMLNode.Validate Method
Word Developer Reference |
Validates an individual XML element against the XML schemas that are attached to a document.
Syntax
expression.Validate
expression An expression that returns an XMLNode object.
Return Value
Nothing
Remarks
Use the Validate method with the ValidationStatus and ValidationErrorText properties to determine if an XML element is valid against the applied schema and what error text to display to the user. Use the SetValidationError method to override the schema violations with custom validation errors.
When you run the Validate method, Microsoft Office Word populates the XMLSchemaViolations property of the Document object with a collection of the XML nodes that have validation errors.
Example
The following example checks each element and attribute in the active document and displays a message containing the elements and attributes that do not pass validation, according to the schema, and a description of why.
Visual Basic for Applications |
---|
|
See Also