Code to open another user's inbox when I'm in cached exchange mode

M

mcollins

I am trying to execute the following code in cached exchange mode in a
workstation installation of Outlook 2003:

Public oMapi As NameSpace
Public ofFolder As MAPIFolder

Sub getPartnerPrivate()
Dim oFolders As Folders
Dim oRecip As Recipient

Set oMapi = Application.GetNamespace("MAPI")
Set oRecip = oMapi.CreateRecipient("partnerprivate")
oRecip.Resolve
Set ofFolder = oMapi.GetSharedDefaultFolder(oRecip, olFolderInbox)
ofFolder.Display
End Sub

Can't. I believe I need to write using Extended MAPI but have no idea.
Would anybody know?
 
S

Sue Mosher [MVP-Outlook]

Can't what? What symptoms tell you there's a problem? Does oRecip resolve to an Exchange user?
 
M

mcollins

If the user I am testing this with is in cached exchange mode the code fails
on this line:

Set ofFolder = oMapi.GetSharedDefaultFolder(oRecip, olFolderInbox)

Outlook's error message is to the effect that it could not resolve the
oRecip value. If I take the user out of cached mode, the code works, the
inbox window opens.

I seem to have read somewhere that this is by design and that there might
be a solution using the MAPI_NO_CACHE flag in C++. However, I need a VBA
solution.
 
S

Sue Mosher [MVP-Outlook]

What happens if you type partnerprivate into a message? Does it resolve to an Exchange user there? If not, that's your problem.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


mcollins said:
If the user I am testing this with is in cached exchange mode the code fails
on this line:

Set ofFolder = oMapi.GetSharedDefaultFolder(oRecip, olFolderInbox)

Outlook's error message is to the effect that it could not resolve the
oRecip value. If I take the user out of cached mode, the code works, the
inbox window opens.

I seem to have read somewhere that this is by design and that there might
be a solution using the MAPI_NO_CACHE flag in C++. However, I need a VBA
solution.
 
M

mcollins

It resolves perfectly fine. In fact, I was hoping that doing this, i.e.,
sending an email to the private mailboxes from the user I installed the code
on, might solve the problem (we have a number of these private mailboxes),
but it was inconsistent. It sounds like you don't think this is expected
behavior.
 
S

Sue Mosher [MVP-Outlook]

But does it resolve to an Exchange user or to a name in the Contacts folder?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


mcollins said:
It resolves perfectly fine. In fact, I was hoping that doing this, i.e.,
sending an email to the private mailboxes from the user I installed the code
on, might solve the problem (we have a number of these private mailboxes),
but it was inconsistent. It sounds like you don't think this is expected
behavior.
 

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