Iterate through Outlook Folders or Mailboxes

S

stonecoldvirgo

I have been tasked with a project to collect contact records from
everyone in my firm. Instead of having them package them up and send
them to me, I'd like to reach out to their computers from my own and
simply extract their contacts to a database. I've already got the
routine working beautifully for one folder but I've got a few dozen to
do. Copy/pasting the code a few dozen times so it all runs at once
isn't really what I want to do, nor do I want to babysit this routine
and change the mailbox name for every person in the firm every time I
run it. I'm looking for suggestions. I'm wondering if there is a way
I can iterate through mailboxes without having to specifically
identify each mailbox for each run. This is how I identify the folder
I'm working on:

Set cf = olns.Folders("Mailbox - Smith, John").Folders("Contacts")

Now, I'd like to know if there is a way to iterate through all the
mailboxes on the network instead of having to manually identify each
mailbox in turn. I've got the rights I need from my admin to reach
out and grab the information so that isn't an issue. Just need to
know how I can programmatically iterate through the mailboxes.
Thanks!

--Patrick
 

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