元验证方法 (Office)MetaProperty.Validate method (Office)

根据架构验证代表单个属性值的属性对象。Validates a MetaProperty object representing a single property value according to a schema.

语法Syntax

表达式验证expression.Validate

_表达式_一个返回**** 类型对象的表达式。expression An expression that returns a MetaProperty object.

返回值Return value

StringString

说明Remarks

如果属性无效,则测试将失败并返回一条错误消息。If the property is invalid, the test fails and an error message is returned. 用于验证的架构作为文档的 Microsoft SharePoint Foundation 配置文件的一部分存储。The schema used for validation is stored as part of the document's Microsoft SharePoint Foundation profile.

示例Example

在下面的示例中, MetaProperties 对象将传递给验证函数。In the following example, a MetaProperties object is passed to a validation function. 该函数然后验证单个属性的值(由其索引代表),并返回结果。The function then validates the value of a single property represented by its index and returns the result.

Function ValidateMetaProperty(ByVal metaProps As MetaProperties) As String 
Dim result As String 
 
result = metaProps(1).Validate 
ValidateMetaProperty = result 
End Function

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.