Skip to Content
CDO & MAPI Programming with Visual Basic:
book

CDO & MAPI Programming with Visual Basic:

by Dave Grundgeiger
October 2000
Intermediate to advanced
384 pages
10h 22m
English
O'Reilly Media, Inc.
Content preview from CDO & MAPI Programming with Visual Basic:

Programmatically Discovering Profile Names and the Default Profile

Application programs can examine the Windows registry to determine the names of the profiles set up for a user, as well as which profile is the user’s default profile. The registry key used for this purpose on a Windows 9x system is:

HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles

On Windows NT, the key is:

HKEY_CURRENT_USER\Software\Microsoft\WINDOWS NT\CURRENTVERSION\Windows Messaging 
Subsystem\Profiles

Regardless of operating system, the key has a string value called DefaultProfile that contains the name of the user’s default MAPI profile (if the user has a default profile). In addition, the key has a subkey for each profile that has been set up for the user. The name of each subkey corresponds to the name of the associated profile. Example 2-3 shows two functions for accessing this information on a Windows 9x machine. GetDefaultProfileName returns the user’s default profile name, and GetProfileNames returns a string array containing the names of the user’s profiles. As in Example 2-2, several registry-related constants and API functions must be declared.

Example 2-3. Obtaining Profile Names from the Windows 9x Registry

' Place these declarations at the module level. Public Const HKEY_LOCAL_MACHINE = &H80000002 Public Const HKEY_CURRENT_USER = &H80000001 Public Const KEY_QUERY_VALUE = &H1 Public Const ERROR_SUCCESS = 0& Public Const ERROR_FILE_NOT_FOUND = 2& Public Type FILETIME dwLowDateTime ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
COM Programming with Microsoft® .NET

COM Programming with Microsoft® .NET

John Paul Mueller, Julian Templeman

Publisher Resources

ISBN: 156592665XSupplemental ContentCatalog PageErrata