If Outlook is not running when you create a NameSpace object variable, the user will be prompted for a profile if the user's mail services startup setting is set to Prompt for a profile to be used. Startup settings are on the Mail Services tab of the Options dialog box (Tools menu). You can use the NameSpace object's Logon method to specify a profile programmatically. Profiles are stored in the Windows registry under the \HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles subkey.
Here is the (untested) VB equivalent code of what you are trying to do:
Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNameSpace("MAPI") myNameSpace.Logon "myProfile", "myPassword", True, True
In reply to Re: Dealing with Popup-windows while connecting Outlook
by NetWallah
in thread Dealing with Popup-windows while connecting Outlook
by banduwgs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |