Programmatically count # of Outlook Profiles w/o accessing registr

N

N11689

I am using the Microsoft.Office.Interop.Outlook PIAs for 2003.

I am coding to automatically logon using the default profile by passing in
"" as the username and password to the logon method:
----------------------------------------------------------------------------------------------

Dim objOutlookApplication As Object
Dim objMapiNameSpace As Object

'Create Outlook application.
objOutlookApplication = CreateObject("Outlook.Application")
objMapiNameSpace = objOutlookApplication.getnamespace("mapi")
objMapiNameSpace.Logon("", "", True, True)
------------------------------------------------------------------------------------------------

However, if there are multiple outlook profiles on the machine, I don't want
to automatically use the default profile. I want to prompt the user to
logon.

Without accessing the registry, how can I programmatically count the number
of default outlook profiles on the machine?

I am using VB.NET 2005
 
K

Ken Slovak - [MVP - Outlook]

You can't without using the registry or another API than the Outlook object
model. The Redemption (www.dimastr.com/redemption) COM wrapper for Extended
MAPI comes with a utility for working with profiles, otherwise you're stuck
using the registry.
 

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