in reply to Dealing with Popup-windows while connecting Outlook

From MSDN

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

Replies are listed 'Best First'.
Re: Re: Dealing with Popup-windows while connecting Outlook
by banduwgs (Beadle) on Aug 18, 2003 at 14:00 UTC

    This is a really good solution for me, if it is possible to apply in Perl. When I call
    $namespace->login("profile", "password", 0, 1);
    it gives:

    retrying default method at .../site/lib/"in32/OLE/Lite.pm line 156.
    Win32::OLE(0.1403) error 0x8002000e: "Invalid number of parameters" in METHOD/PROPERTYGET "" at <path> Line <#>

    I think this might be since login method is not implimented in OLE module.

    Do you have any alternation to achieve the success here? - SB

      The method name you need is logon , not login.

      Documentation for this method is here

      Change your code as shown below, and retry.

      $namespace->logon("profile", "password", 0, 1);