Programmatically count # of Outlook Profiles w/o accessing registr

  • Thread starter Thread starter N11689
  • Start date Start date
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
 
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.
 
Back
Top