Is there any free property of a ContactItem in which I can add the ID of the contact from a DB. I want to modify the contact in Outlook each time it's modified in my VB Application and this way, it would be easier to find the contact in outlook.
Printable View
Is there any free property of a ContactItem in which I can add the ID of the contact from a DB. I want to modify the contact in Outlook each time it's modified in my VB Application and this way, it would be easier to find the contact in outlook.
The .EntryID field is the unique identifier in Outlook. You can add custom properties if you want or just use some obscure base field.
Bring up a contact in Outlook, go to Tools > Forms > Design this form... > All Fields tab > select All Contact fields...
This will show you ALL the contact fields and if the ContactItem Form is a standard Outlook Form and hasnt been modified then all the fields will be default across all Contact Items.
You could use the Customer ID, Government ID Number, UserField1 - UserField4. :D
These fields will never be changed by Outlook ? So I put my DB field index in it and compare with it after?
Actually, my mistake. You dont need to go into design view of the form but anyone could click the All Fields tab and change the values for any of the visible fields. If you want you could look at the UserProperty or ItemProperty for adding a custom property.
What is the fastest way to retrieve a ContactItem if I have about 2500.
Right now i'm doing this but it's really slow, it takes something like 2 minutes to go through all the ContactItem.
VB Code:
For Each otlContact In folContact.Items If otlContact.User1 <> "" Then If otlContact.User1 = m_iNoContact Then Exit For End If End If Next
If your saving the .EntryID of the contact item then you can use a quick method without looping...
VB Code:
Dim oApp As Outlook.Application Dim oNS As Outlook.NameSpace Set oApp = New Outlook.Application Set oNS = oApp.GetNamespace("MAPI") Dim oContact As Outlook.ContactItem Set oContact = oNS.GetItemFromID("EntryID", "EntryIDStore") MsgBox oContact.FullName ' "VB/Outlook Guruâ„¢"