Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
90 lines (57 loc) · 2.28 KB

customxmlvalidationerror-object-office.md

File metadata and controls

90 lines (57 loc) · 2.28 KB
title keywords f1_keywords ms.prod api_name ms.assetid ms.date
CustomXMLValidationError Object (Office)
vbaof11.chm307000
vbaof11.chm307000
office
Office.CustomXMLValidationError
7f7ced9a-0878-9287-fe66-a7f0ffdc45b6
06/08/2017

CustomXMLValidationError Object (Office)

Represents a single validation error in a CustomXMLValidationErrors collection.

Remarks

Validation errors can either be triggered when validating an operation against the schema, such as when adding a node, or triggered by the user when some condition is not met. For example, if a start date is later than an end date.

Example

The following example adds a custom part and then adds a child node to that part. Any errors that occur are added to the CustomXMLValidationErrors collection and then displayed in the Debug window.

Dim ValErrors As CustomXMLValidationErrors 
Dim ValError As CustomXMLValidationError 
Dim cxp1 As CustomXMLPart 
Dim intError As Integer 
 
On Error Go To validation_error 
 
 With ActiveDocument 
 
    ' Add and populate a custom xml part 
    set cxp1 = .CustomXMLParts.Add "<invoice>" 
 
    ' Add a node 
    cxp1.AddNode "<quantity>", "supplier", "urn:invoice:namespace" 
 
 End With 
 
If ValErrors.Count > 0 then 
   For Each ValError In ValErrors 
      DeBug.Print("Error name: " &amp; ValError.Name &amp; " Error description: " &amp; ValError.Text)  
   Next 
End If 
 
Exit Sub 
 
validation_error: 
   CustomXMLValidationErrors.Add(ValError.Name, ValError.Text)) 
Resume

Methods

Name
Delete

Properties

Name
Application
Creator
ErrorCode
Name
Node
Parent
Text
Type

See also

Other resources

Object Model Reference