1

I've created a VB.Net application that starts by creating an Outlook application object. I've since created multiple profiles on my PC but can't see any obvious methods to choose a certain Profile when opening the Outlook application programmatically.

I was expecting this line

Dim oa As New Microsoft.Office.Interop.Outlook.Application

to become something like

Dim oa As New Microsoft.Office.Interop.Outlook.Application
oa.OpenProfile("My Second Profile")

What can I do to explicitly set which profile to open, or is something wrong with my understanding of the Outlook object model?

2 Answers 2

1

Redemption seems to let me choose profiles, based on what I can see in the documentation, and there's an additional product you can get to manage profiles specifically at the site.

0

The answer is that I have the wrong understanding of the Outlook object model. The following code lets me 'pick' a profile (after already adding a reference and importing Microsoft.Office.Interop.Outlook at the top of my module):

Dim appOutlook As New Application
Dim nmsNamespace As [NameSpace]
nmsNamespace = appOutlook.GetNamespace("MAPI")
nmsNamespace.Logon("TestMailBox3")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.