Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting an Outlook User Profile

Status
Not open for further replies.

JerryKlmns

IS-IT--Management
Feb 7, 2005
2,062
GR
Hello World!

How can I programmaticaly select, a specific user profile when opening Outlook with automation, if the user has more than one?
 
Check the "Alias" its unique for each user in Outlook


DougP, MCP, A+
 
I dont know if this is what I 'm lloking for.
So what I want is this:
Today user GK, clicks outlook, chooses a profile from 2 installed and uses outlook on that PC with the profile say "SBB". Or chooses the second profile say "GK" and uses outlook on the same PC with this profile.
Objective: Using automation start Outlook, programmaticaly select profile "SBB" and go on.
Now each time I use automation to start Outlook (on his PC)he has to choose that profile to start outlook.

DougP, if thats what you said, PLS could you be more analytic?

Thanks in advance!
 
Logon Method

Logs the user on to MAPI, obtaining a MAPI session.

Syntax
objNameSpace.Logon([Profile,] [Password,] ]ShowDialog,] [NewSession])

objNameSpace An expression that returns a NameSpace object.

Profile Optional String. The profile name to use for the session.

Password Optional String. The password (if any) associated with the profile.

ShowDialog Optional Boolean. True to display the MAPI logon dialog.

NewSession Optional Boolean. True to create a new session (doesn't use an existing session). Multiple sessions cannot be created in Outlook.

And an example
Code:
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
myNameSpace.Logon "myProfile", "myPassword", True, True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top