|
-
Aug 4th, 2005, 10:57 AM
#1
Thread Starter
Fanatic Member
ContactItem key
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.
-
Aug 4th, 2005, 11:05 AM
#2
Re: ContactItem key
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 4th, 2005, 12:22 PM
#3
Thread Starter
Fanatic Member
Re: ContactItem key
These fields will never be changed by Outlook ? So I put my DB field index in it and compare with it after?
-
Aug 4th, 2005, 12:29 PM
#4
Re: ContactItem key
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 4th, 2005, 03:11 PM
#5
Thread Starter
Fanatic Member
Re: ContactItem key
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
-
Aug 5th, 2005, 10:49 PM
#6
Re: ContactItem key
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™"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|