Address Book

S

Sue Mosher [MVP-Outlook]

Repeating: When in doubt, check the object browser: Press ALt+F11 to open
the VBA environment in Outlook, then press F2. Switch from <All Libraries>
to Outlook to browse all Outlook objects and their properties, methods, and
events. Select any object or member, then press F1 to see its Help topic.

If you looked up the Items collection in the object browser, you'd see that
it has a Count property that you can use to determine whether there are any
items in the folder.

You can iterate any Items collection with a For Each ... Next loop:

Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Items
If colContacts.Count > 0 Then
For Each objItem in colContacts
Debug.Print objItem.Subject
Next
Else
Debug.Print "No contacts in default folder"
End If


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Roy said:
So then, colContacts stores all of the items in my contacts folder.

How can I print colContacts to the Immediate Folder. I want to see if
colContacts is storing anything or if it is coming up empty because it
cannot find the default Contacts folder. I especially want to see what
colContacts is storing.
For example, if colContacts is empty I can then see why "Set objContact = olContacts.Find(strFind)"
would be spitting out an error.

I would also like to compare colContacts information to the list I have in
my Contacts folder. IF the list matches, then I have eliminated this line
of code from debugging. But if the conetnts of colContacts is coming up
empty, then I know I have to do further research on this line of code.
Thanks.

----- Sue Mosher [MVP-Outlook] wrote: -----

Namespace.GetDefaultFolder() returns your default Contacts folder, i.e. the
one in the hierarchy whose top level is labeled Outlook Today, the same one
where your default Inbox resides. The Items collection is the collection of
all items in that folder.

When in doubt, check the object browser: Press ALt+F11 to open the VBA
environment in Outlook, then press F2. Switch from <All Libraries> to
Outlook to browse all Outlook objects and their properties, methods, and
events. Select any object or member, then press F1 to see its Help topic.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Roy said:
Hello Sue,
or have
simply given up on it.
Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Items
up. I
imagine this code is bringing up all the contacts in my contact folder. IF
it is not, can you please explain what that line of code is doing.
 
G

Guest

In my address book i have distribution lists and contacts. is there a way
I can just print out the cantacts without the distribution lists. Thank you
--
Thanks for the info


Russ Valentine said:
Then why did you say you were using a PAB?
I already told you that you can't make this happen. Autocompletion uses a
cache derived from messages you have already sent, not your Contacts Folder.
--
Russ Valentine
[MVP-Outlook]
Roy said:
I am not using PAB. I'm using Outlook Address Book and my Contacts Folder.

The only problem is when I reply to someone, shouldn't his e-mail address
be added to my contacts folder automatically. This is not happening. Can
you please tell me how can I make this happen.
 
G

Guest

--
Thanks for the info


bonball said:
In my address book i have distribution lists and contacts. is there a way
I can just print out the cantacts without the distribution lists. Thank you
--
Thanks for the info


Russ Valentine said:
Then why did you say you were using a PAB?
I already told you that you can't make this happen. Autocompletion uses a
cache derived from messages you have already sent, not your Contacts Folder.
--
Russ Valentine
[MVP-Outlook]
Roy said:
I am not using PAB. I'm using Outlook Address Book and my Contacts Folder.

The only problem is when I reply to someone, shouldn't his e-mail address
be added to my contacts folder automatically. This is not happening. Can
you please tell me how can I make this happen.
 
R

Russ Valentine [MVP-Outlook]

Lots of them:
http://www.slipstick.com/contacts/print.htm

--
Russ Valentine
[MVP-Outlook]
bonball said:
In my address book i have distribution lists and contacts. is there a way
I can just print out the cantacts without the distribution lists. Thank you
--
Thanks for the info


Russ Valentine said:
Then why did you say you were using a PAB?
I already told you that you can't make this happen. Autocompletion uses a
cache derived from messages you have already sent, not your Contacts Folder.
--
Russ Valentine
[MVP-Outlook]
Roy said:
I am not using PAB. I'm using Outlook Address Book and my Contacts Folder.

The only problem is when I reply to someone, shouldn't his e-mail
address
be added to my contacts folder automatically. This is not happening. Can
you please tell me how can I make this happen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top