ContactItem 属性 (Outlook)ContactItem.Email2EntryID property (Outlook)

返回一个字符串, 表示联系人的第二个电子邮件条目的条目 ID。Returns a String representing the entry ID of the second email entry for the contact. 此为只读属性。Read-only.

语法Syntax

expressionexpression. Email2EntryID

_表达式_一个代表ContactItem对象的变量。expression A variable that represents a ContactItem object.

说明Remarks

此属性对应于 MAPI 命名属性dispidEmail2OriginalEntryIDThis property corresponds to the MAPI named property dispidEmail2OriginalEntryID.

如果您在 Microsoft visual basic 或 microsoft visual basic for Applications (VBA) 解决方案中获取此属性, owing 在某些类型问题 (而不是直接引用Email2EntryID) 中获取该属性, 则应通过**PropertyAccessor** 对象由**ContactItem** 属性返回, 指定 mapi 属性PidLidEmail2OriginalEntryId属性及其 mapi id 命名空间。If you are getting this property in a Microsoft Visual Basic or Microsoft Visual Basic for Applications (VBA) solution, owing to some type issues, instead of directly referencing Email2EntryID, you should get the property through the PropertyAccessor object returned by the ContactItem.PropertyAccessor property, specifying the MAPI property PidLidEmail2OriginalEntryId property and its MAPI id namespace. 在 VBA 中下面的代码示例显示了解决方法。The following code sample in VBA shows the workaround.

Public Sub GetEmail2EntryID() 
 
 Dim objContactFolder As Outlook.Folder 
 
 Dim objContactItem As Outlook.ContactItem 
 
 Dim objRec As Outlook.Recipient 
 
 Dim strEntryID As String 
 
 Dim oPA As Outlook.PropertyAccessor 
 
 Const EMAIL2_ENTRYID As String = "http://schemas.microsoft.com/mapi/id/{00062004-0000-0000-C000-000000000046}/80950102" 
 
 
 
 Set objContactFolder = Application.Session.GetDefaultFolder(olFolderContacts) 
 
 Set objContactItem = objContactFolder.Items(1) 
 
 Set oPA = objContactItem.PropertyAccessor 
 
 strEntryID = oPA.BinaryToString(oPA.GetProperty(EMAIL2_ENTRYID)) 
 
 Debug.Print strEntryID 
 
 Set objRec = Application.Session.GetRecipientFromID(strEntryID) 
 
 If objRec Is Nothing Then 
 
 Debug.Print "GetRecipientFromID failed" 
 
 Else 
 
 Debug.Print objRec.Name 
 
 Debug.Print objRec.EntryID 
 
 End If 
 
 
 
 'Cleanup 
 
 Set objContactItem = Nothing 
 
 Set objContactFolder = Nothing 
 
End Sub

另请参阅See also

创建 ContactItem 对象ContactItem Object

支持和反馈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.