Outlook) (ItemProperty.IsUserProperty 属性

返回一个 布尔 值,指示项目属性是否是用户创建的自定义属性。 此为只读属性。

语法

expressionIsUserProperty

表达 一个代表 ItemProperty 对象的变量。

示例

The following example displays the names of all properties created by the user. 子例程DisplayUserProps接受 ItemProperties 集合并在其中搜索,显示 IsUserProperty 值为 True 的所有 ItemProperty 对象的名称。 The ItemProperties collection is zero-based. In other words, the first object in the collection is accessed with an index value of zero (0).

Sub ItemProperty() 
 'Creates a new mail item and access it's properties 
 Dim objMail As MailItem 
 Dim objitems As ItemProperties 
 
 'Create the mail item 
 Set objMail = Application.CreateItem(olMailItem) 
 'Create a reference to the item properties collection 
 Set objitems = objMail.ItemProperties 
 'Create a reference to the item property page 
 Call DisplayUserProps(objitems) 
End Sub 
 
Sub DisplayUserProps(ByVal objitems As ItemProperties) 
 'Displays the names of all user-created item properties in the collection 
 For i = 0 To objitems.Count - 1 
 'Display name of property if it was created by the user 
 If objitems.Item(i).IsUserProperty = True Then 
 MsgBox "The property " & objitems(i).Name & " was created by the user." 
 End If 
 Next i 
End Sub

另请参阅

ItemProperty 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。