Table of contents
TOC
折叠目录
展开目录

CustomXMLValidationError 对象 (办公室)CustomXMLValidationError Object (Office)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

表示一个验证错误CustomXMLValidationErrors集合中。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

下面的示例添加一个自定义部件,然后将子节点添加到该部分。出现的任何错误都添加到CustomXMLValidationErrors集合,然后在调试窗口中显示。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
DeleteDelete

属性Properties

名称Name
ApplicationApplication
CreatorCreator
错误代码ErrorCode
名称Name
节点Node
ParentParent
TextText
TypeType

另请参阅See also

其他资源Other resources

对象模型引用Object Model Reference

© 2018 Microsoft