Share via


CustomXMLValidationErrors.Add Method (Office)

Adds a CustomXMLValidationError object containing an XML validation error to the CustomXMLValidationErrors collection.

Syntax

expression .Add(Node, ErrorName, ErrorText, ClearedOnUpdate)

expression An expression that returns a CustomXMLValidationErrors object.

Parameters

Name

Required/Optional

Data Type

Description

Node

Required

CustomXMLNode

Represents the node where the error occurred.

ErrorName

Required

String

Contains the name of the error.

ErrorText

Optional

String

Contains the descriptive error text.

ClearedOnUpdate

Optional

Boolean

Specifies whether the error is to be cleared from the CustomXMLValidationErrors collection when the XML is corrected and updated.

Example

The following example adds an error message to the collection.

Dim objCustomXMLValidationErrors as CustomXMLValidationErrors 
 
On Error GoTo Err 
 
' Adds the specified error message to the collection. 
objCustomXMLValidationErrors.Add("//badTag", "ValidationError", "To add content to this stream, it must be valid, well-formed XML.", True) 

See Also

Concepts

CustomXMLValidationErrors Object Members

CustomXMLValidationErrors Object