?
Solved

Iterate thru Outlook Contact properties

Posted on 2011-09-26
2
Medium Priority
?
354 Views
Last Modified: 2012-05-12
How do I Iterate thru Outlook Contact properties. The following code works:

            Dim oApp As Outlook.Application = New Outlook.Application()
            Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
            oNS.Logon("Outlook", , False, True)
            Dim mainFolder As Outlook.MAPIFolder
            mainFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
            Dim subFolder As Outlook.Folder
            For Each subFolder In mainFolder.Folders
                If subFolder.Name = TextBoxFolderName.Text Then
                    Dim _Contacts As Outlook.Items = subFolder.Items
                    Dim _Contact As Outlook.ContactItem
                    For Each _Contact In _Contacts
                        Dim istr As String = _Contact.FullName
                        Dim ilb As Object = _Contact.EntryID
                        'HOW DO I ITERATE THRU ALL COLUMNS / PROPERTIES INSTEAD OF STRONGLY TYPING EACH PROPERTY?
                    Next _Contact
                End If
            Next subFolder
0
Comment
Question by:JWyrschSr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
ienaxxx earned 2000 total points
ID: 36599989
Hi, you should have a look at ItemProperties collection.

Here:
http://msdn.microsoft.com/en-us/library/aa210924%28v=office.11%29.aspx


Using it you can simply have a collection of properties to iterate on.

HTH
Bye!
0
 

Author Closing Comment

by:JWyrschSr
ID: 36601897
The link referred to was for email, not contacts.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read this checklist to learn more about the 15 things you should never include in an email signature.
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question