[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Iterate thru Outlook Contact properties

Posted on 2011-09-26
2
Medium Priority
?
357 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

656 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