Ask a questionAsk a question
 

AnswerCan CDO send email when Outlook is closed?

  • Thursday, October 29, 2009 10:31 PMJM6 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I have an Excel macro for creating and sending an Outlook email message using CDO.  There's a reference to "Microsoft CDO 1.21 Library".  The code starts the session with:

      Set objSession = CreateObject("MAPI.Session")

    Then it creates the message and runs:

      objMessage.Update
      objMessage.Send showDialog:=False
      objSession.DeliverNow

    The message goes to the Outbox and sends okay if Outlook is running.  If Outlook is closed, the message goes to the Outbox but stays there until I start Outlook.  I need it to send when Outlook is closed.  How do I do this?

    Thanks for the help.

Answers

  • Friday, October 30, 2009 8:19 PMJM6 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I've got it opening Outlook with its /recycle switch.  Problem solved.
    • Marked As Answer byJM6 Friday, October 30, 2009 8:19 PM
    •  

All Replies

  • Friday, October 30, 2009 5:10 AMJM6 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Alternatively, is there a way to know if Outlook is already running?  Then if it isn't, I could start it with the Shell function.
  • Friday, October 30, 2009 8:19 PMJM6 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I've got it opening Outlook with its /recycle switch.  Problem solved.
    • Marked As Answer byJM6 Friday, October 30, 2009 8:19 PM
    •