Downloads
4656.zip

If you want to authenticate to another user's profile, you can use the NameSpace object's Logon and Logoff methods. As Listing A shows, you first need to authenticate to Outlook and create a reference to the NameSpace object. You then use the NameSpace object's Logon method with four parameters.

The first parameter is the profile name to use for the log on. The blank value in Listing A specifies that you want to use the current logged-on user. If you set an empty string, you will use the default profile to log on with.

The second parameter is the profile password. Once again, a blank value signifies the current logged-on user and a blank string signifies the default Outlook profile.

The third parameter specifies whether you want to display the Outlook Profile dialog box. You put True if you want to display the Profile dialog box and False if you don't.

The fourth parameter specifies whether you want to start a new Outlook session. You put True if you want to start a new Outlook session and False if you want to use the current session. If you don't log on and Outlook is already running, Outlook uses the current session and profile.