Can I get a list of profiles?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Obviously I can use a specific profile using NameSpaceClass.Logon, but can I
get a list of the profiles?

I can't find this anywhere?
 
Am Tue, 26 Sep 2006 16:46:02 -0700 schrieb Anyone for Coffee?:

It´s in the registry under:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
Messaging Subsystem\Profiles
 
Thanks Michael,
Can you confirm that this is the case for Office 2k, XP, 2k3 & 2k7.
Also is it a user-configurable location? (Might a enterprise, for some
reason best known to themselves, move this key?)

David
 
It does not depend on the Outlook version, only on the Windows version.
Under 95/98/ME, it will be Software\Microsoft\Windows Messaging
Subsystem\Profiles
Also note that the Unicode profile names are encoded in the registry.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
I use the following code to logon:

ApplicationClass outlookApplication = new ApplicationClass();
NameSpaceClass outlookNameSpace = outlookApplication.GetNamespace("MAPI") as
NameSpaceClass;
outlookNameSpace.Logon(profileName, System.Reflection.Missing.Value, false,
true);

I then look at the folders in the namespace like this:

FoldersClass foldersClass = outlookNameSpace.Folders as FoldersClass;
for (int i = 1; i <= foldersClass.Count; ++i)
{
// use foldersClass.Item(i)
}


If I have an Outlook process running, the list of folders is for that profile.
If I have no Outlook process running, the list of folders is for the Default
Profile.

ie the Logon call does nothing.

I suspect I want to be using something like....
NameSpaceClass outlookNameSpace = outlookApplication.GetNamespace("MAPI",
profileName) as NameSpaceClass;
..... but such a call doesn't exist.


So how to I get the folders from the other profile?
 
It's the same path as on WinXP/2000 here on my Vista setups:
HKCU\Software\Microsoft\Windows NT\Current Version\Windows Messaging
Subsystem\Profiles.
 
Can't do that with Outlook. Since only one instance of outlook.exe can run
at any time, creating a "new" Outlook.Application object returns the already
running instance.
You will need to use Extended MAPI, CDO 1.21 or Redemption to log to a
profile other than the one currently used by Outlook.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top