how to retrieve message from another profile?

  • Thread starter Thread starter Tim Zych
  • Start date Start date
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'")
 
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'")
 
Back
Top