This Visual Basic for Applications example uses the Logon method to log on to a new session, displaying the dialog box to verify the profile name and password.
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
myNameSpace.Logon "myProfile", "myPassword", True, True