none
Outlook. Contact folder. Get all fields RRS feed

  • Question

  • Hello friends!!! I need help!

    I get the item 1 in contact folder:

    Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items(1)

    This way I can get "All contact filelds"  ( https://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.contactitem_properties%28v=office.14%29.aspx )

    How do I get the rest of the field?(For example "All Document filelds")

    Wednesday, February 18, 2015 11:29 AM

Answers

  • So do you see the property you are after in OutlookSpy? I bet you need PR_DISPLAY_TO. You can retrieve it using

    ContactItem.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E04001F")


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by q2ker1 Wednesday, February 18, 2015 3:48 PM
    Wednesday, February 18, 2015 3:40 PM

All replies

  • The Folder class provides the UserDefinedProperties property which returns a UserDefinedProperties object that represents the user-defined custom properties for the Folder object.

    Also you can use the UserProperties property of Outlook items which returns the UserProperties collection that represents all the user properties for the Microsoft Outlook item, for example:

    Sub FindContact()
    'Finds and displays last contacted info for a contact
    
        Dim olApp As Outlook.Application
        Dim objContact As Outlook.ContactItem
        Dim objContacts As Outlook.MAPIFolder
        Dim objNameSpace As Outlook.NameSpace
        Dim objProperty As Outlook.UserProperty
    
        Set olApp = CreateObject("Outlook.Application")
        Set objNameSpace = olApp.GetNamespace("MAPI")
        Set objContacts = objNameSpace.GetDefaultFolder(olFolderContacts)
        Set objContact = objContacts.Items.Find("[FileAs] = ""Smith, Jeff"" and [FirstName] = ""Jeff""")
        If Not TypeName(objContact) = "Nothing" Then
            Set objProperty = objContact.UserProperties.Find("LastDateContacted")
            If TypeName(objProperty) <> "Nothing" Then
                MsgBox "Last Date Contacted: " & objProperty.Value
            End If
        Else
            MsgBox "The contact was not found."
        End If
    End Sub



    Wednesday, February 18, 2015 12:08 PM
  • Thanks, but i want see "All Document filelds".
    Wednesday, February 18, 2015 12:46 PM
  • In Outlook Object Model, there is no way to retrieve the reserved fields in code like "All Document Fields". 

    However, there is a method PropertyAccessor.GetProperty() to get the value of a property not the property name. About Property.GetProperty() method, you could refer to the following resou
    rces.
    PropertyAccessor.GetProperty Method: http://msdn.microsoft.com/en-us/library/bb207521.aspx.
    PropertyAccessor.GetProperty Method (C#):http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/272a2355-d3c2-478d-9bb0-63ead6cff5be/
    Wednesday, February 18, 2015 1:01 PM
  • This is just how these properties are represented in the Outlook UI. Is there a particular property that you need to access?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, February 18, 2015 2:56 PM
  • In Outlook Object Model, there is no way to retrieve the reserved fields in code like "All Document Fields". 

    However, there is a method PropertyAccessor.GetProperty() to get the value of a property not the property name. About Property.GetProperty() method, you could refer to the following resou
    rces.
    PropertyAccessor.GetProperty Method: http://msdn.microsoft.com/en-us/library/bb207521.aspx.
    PropertyAccessor.GetProperty Method (C#):http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/272a2355-d3c2-478d-9bb0-63ead6cff5be/

    Thank U. It is very difficult for me. Could you give an example of code for use. Links do not understand how to apply (((
    Wednesday, February 18, 2015 3:19 PM
  • *Which* property are you trying to retrieve? Look at the contact with OutlookSpy (click IMessage).

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, February 18, 2015 3:21 PM
  • This is just how these properties are represented in the Outlook UI. Is there a particular property that you need to access?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    "All Document Fields" - To or "all fields of the meeting" mandatory participants
    Wednesday, February 18, 2015 3:23 PM
  • On a contact? What for? Contacts are never sent.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, February 18, 2015 3:27 PM
  • On the form there was a mistake in the design and field, which should be delivered the address is selected (((
    Wednesday, February 18, 2015 3:36 PM
  • So do you see the property you are after in OutlookSpy? I bet you need PR_DISPLAY_TO. You can retrieve it using

    ContactItem.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E04001F")


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by q2ker1 Wednesday, February 18, 2015 3:48 PM
    Wednesday, February 18, 2015 3:40 PM
  • With Outlook Spy I find this field. How do I do this programmatically?

    Wednesday, February 18, 2015 3:41 PM
  • See my previous reply.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, February 18, 2015 3:44 PM
  • Miracle!
    Wednesday, February 18, 2015 3:47 PM