편집

다음을 통해 공유


ItemProperty.IsUserProperty property (Outlook)

Returns a Boolean value that indicates if the item property is a custom property created by the user. Read-only.

Syntax

expression. IsUserProperty

expression A variable that represents an ItemProperty object.

Example

The following example displays the names of all properties created by the user. The subroutine DisplayUserProps accepts an ItemProperties collection and searches through it, displaying the names of all ItemProperty objects where the IsUserProperty value is True. 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

See also

ItemProperty Object

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.