referencing outlook archive file using vba

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I am trying to find code to enable me to reference an Outlook file that is
archived eMails on a server (e.g. \\Michael\Data\Outlook\Humor.pst).

I would like to use the following code so that the Inbox referenced below is
using the file in the path above.
Set OLF = GetObject("",
"Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)

I would greatly appreciate any assistance.

Thanks.

Michael
 
Hi Michael,

at first add the file into your session:

Application.Session.AddStore "YourFile"

Then the topfolder should be
with Application.Session.Folders
set topfolder=.Item(.Count)
end with

In "topfolder" you can now look for the Inbox, e.g. by the foldername.
 
Back
Top