To Outlook VBA gurus...

  • Thread starter fabien.turcotte
  • Start date
F

fabien.turcotte

Hi all,

I'm using Office 2003.

I'm pretty used to VBA with Excel and Access, but not quite familiar
with the Outlook object model. Now, I'm getting some Outlook stuff
into my Excel program.

In a program, I have the user select a folder using

Set olkApp = CreateObject("Outlook.Application")
Set olkNmsp = olkApp.GetNamespace("MAPI")
Set olkMAPI = olkNmsp.PickFolder


The olkMAPI folder's name value is stored at some place (in an Excel
range) for further use.

What I'm trying to do, is to reconnect to Outlook later on an try to
reopen the same folder that was previously returned.

When I recreate the connection, what do I have to do to reassign
olkMAPI to the value stored in my range?

Set olkApp = CreateObject("Outlook.Application")
Set olkNmsp = olkApp.GetNamespace("MAPI")
Set olkMAPI = ??????

I tried olkNmsp.GetFolderFromID, looked at the Explorer object, tried
to look if I could connect using the FolderPath (outlook:\\Mailbox Name
\Inbox\SubFolder)...

Can you guys tell me how I can do this,

Thanks a million,
 
S

Sue Mosher [MVP]

You're on the right track. Store the folder's entry ID, not its name, and
use it with Namespace.GetFolderFromID.
 

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