Outlook Automation and CDO 
Author Message
 Outlook Automation and CDO

I am developing an Access application that reads and processes
incoming emails. The application needs to automatically log on to
Outlook under a different profile and password, do its processing, and
then log off. I am able to log on under a different profile using the
following CDO logon:

     Dim oSession as MAPI.Session

     Set oSession = CreateObject("MAPI.Session")

     oSession.logon ProfileName:="DifferentProfile", _
                    ProfilePassword:="DifferentPassword", _
                    ShowDialog:=True, _
                    NewSession:=False

This code displays the logon dialog box where I enter the password and
I'm in. The problem occurs when I set the ShowDialog parameter to
False. I can't log on to the session then. It's acting as if it's
ignoring the Password parameter. The code needs to run automatically
without user intervention so leaving the ShowDialog parameter set to
True is not an option. So how can I log on to Outlook automatically
(using CDO) with a different profile and password?



Sun, 16 Jan 2005 21:51:19 GMT  
 Outlook Automation and CDO
Profiles don't actually have passwords. Leave it out.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming - coming September 2002
     http://www.slipstick.com/books/jumpstart.htm


Quote:
> I am developing an Access application that reads and processes
> incoming emails. The application needs to automatically log on to
> Outlook under a different profile and password, do its processing, and
> then log off. I am able to log on under a different profile using the
> following CDO logon:

>      Dim oSession as MAPI.Session

>      Set oSession = CreateObject("MAPI.Session")

>      oSession.logon ProfileName:="DifferentProfile", _
>                     ProfilePassword:="DifferentPassword", _
>                     ShowDialog:=True, _
>                     NewSession:=False

> This code displays the logon dialog box where I enter the password and
> I'm in. The problem occurs when I set the ShowDialog parameter to
> False. I can't log on to the session then. It's acting as if it's
> ignoring the Password parameter. The code needs to run automatically
> without user intervention so leaving the ShowDialog parameter set to
> True is not an option. So how can I log on to Outlook automatically
> (using CDO) with a different profile and password?



Sun, 16 Jan 2005 22:16:58 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Outlook Automation or CDO

2. CDO vs Outlook 2000 Object Library?? (Outlook Newbie)

3. VB.NET and Outlook automation - Detect Outlook Version

4. Automation error when using CDO 1.21 Library

5. Help with CDO/Outlook mapi problem

6. CDO vs Outlook libraries

7. CDO & Outlook-Out of memory, messages collection

8. Outlook Object Model and CDO

9. CDO vs. Outlook Object Model

10. MAPI, CDO, WinXP & Outlook 2k - Internet Only

11. How to install CDO after Outlook has already been installed

12. CDO Problem within Outlook

 

 
Powered by phpBB® Forum Software