Google Answers Logo
View Question
 
Q: VBA and MS Outlook ( No Answer,   1 Comment )
Question  
Subject: VBA and MS Outlook
Category: Computers > Programming
Asked by: whychild-ga
List Price: $10.00
Posted: 09 Nov 2002 15:33 PST
Expires: 11 Nov 2002 10:21 PST
Question ID: 104298
How does one iterate over the fields of an Outlook Contact using VBA?
I get this far, but cannot show (for example) the email field
Sub loopContacts()
    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    
        For Each one In myNameSpace.AddressLists
            Debug.Print one.Name
            For Each two In one.AddressEntries
                    Debug.Print "   " + two.Name
            Next
        Next
        Set myOlApp = Nothing
        Set myNameSpace = Nothing
End Sub

Clarification of Question by whychild-ga on 09 Nov 2002 20:06 PST
Actualy I gave a bad example.
I have added some custom fields (xCard and xLetter among others) to
outlook and I want to set update the Categories field based on the
contents of my custom fields...
So I want to iterate across all the contact's fields, and if "xCard"
== Yes then append the string "xCard" to the category field...

something like this

   for each one in allContactFields
       if one = "xCard" then Categories = Categories + "xCard"
   next
Answer  
There is no answer at this time.

Comments  
Subject: Re: VBA and MS Outlook
From: sareeta-ga on 09 Nov 2002 16:31 PST
 
To display the email address you need 

Debug.Print "   " + two.Name & " " & two.Address

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy