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