Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / September 2006

Tip: Looking for answers? Try searching our database.

Can I get a list of profiles?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anyone for Coffee? - 27 Sep 2006 00:46 GMT
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?
Michael Bauer [MVP - Outlook] - 27 Sep 2006 05:25 GMT
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

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
 -- www.VBOffice.net --

> 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?
Anyone for Coffee? - 27 Sep 2006 17:16 GMT
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
Dmitry Streblechenko - 27 Sep 2006 19:25 GMT
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

> 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
Anyone for Coffee? - 27 Sep 2006 19:34 GMT
Thanks Dmitry.
Is it a fair assumption that the location will remain the same for Vista?
Ken Slovak - [MVP - Outlook] - 27 Sep 2006 20:51 GMT
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.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Thanks Dmitry.
> Is it a fair assumption that the location will remain the same for Vista?
Anyone for Coffee? - 27 Sep 2006 21:11 GMT
Anyone for Coffee? - 27 Sep 2006 19:30 GMT
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?
Dmitry Streblechenko - 27 Sep 2006 22:32 GMT
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

> I use the following code to logon:
>
[quoted text clipped - 28 lines]
>
> So how to I get the folders from the other profile?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.