how to retrieve message from another profile?

T

Tim Zych

I have vba code to retrieve an email from my primary profile (we are using
Exchange server with Outlook 2000), but I don't know how to retrieve an
email from another profile that I have rights to view.

How to I get the handle to another profile's inbox?

From Outlook, File -> Open -> Other Users Folder -> "OtherProfile"

Now I can see Inbox I want, how to I set a reference to that
programmatically?

this is what I use to get an email from my primary profile:

---------------------------------
Set olMapi = ol.GetNamespace("Mapi")
Set olInbox = olMapi.GetDefaultFolder(olFolderInbox)
Set olInboxItemCollection = olMapi. _
GetDefaultFolder(olFolderInbox).Items
Set olInboxItem = olInboxItemCollection. _
Find("[Subject] = 'MySubject'")
 
T

Tim Zych

Thanks Sue. I'll try it out Monday. (gee if it's that easy I will be one
happy fella).


Sue Mosher said:
Use GetSharedDefaultFolder instead of GetDefaultFolder.

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



Tim Zych said:
I have vba code to retrieve an email from my primary profile (we are using
Exchange server with Outlook 2000), but I don't know how to retrieve an
email from another profile that I have rights to view.

How to I get the handle to another profile's inbox?

From Outlook, File -> Open -> Other Users Folder -> "OtherProfile"

Now I can see Inbox I want, how to I set a reference to that
programmatically?

this is what I use to get an email from my primary profile:

---------------------------------
Set olMapi = ol.GetNamespace("Mapi")
Set olInbox = olMapi.GetDefaultFolder(olFolderInbox)
Set olInboxItemCollection = olMapi. _
GetDefaultFolder(olFolderInbox).Items
Set olInboxItem = olInboxItemCollection. _
Find("[Subject] = 'MySubject'")
 

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