Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    Michigan, USA
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook message from Excel

    Is there a way to have an Outlook message automatically sent to specific individuals when certain criteria is met in an Excel spreadsheet? If it is possible, should I originate the message using an Outlook form or from Excel?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Outlook message from Excel

    It is indeed possible - I'd suggest doing it from Excel as that's where you're testing to see if the criteria are met.
    Code would be something like this:
    Sub TestOL()
    Dim oOutlookApp As Object
    Dim Mail As MailItem
    Dim strMessage As String
    Set oOutlookApp = GetObject(, "outlook.application")

    Set Mail = oOutlookApp.CreateItem(olMailItem)
    strMessage = "this is the message"
    With Mail
    .Subject = "Important e-mail"
    .To = "Everyone"
    .Body = strMessage
    .Display
    End With
    MsgBox "Send when ready."
    End Sub
    If you set a reference to the Outlook object library you can use early binding too (e.g. Dim oOutlookApp as New Outlook.Application)
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Star Lounger
    Join Date
    Mar 2001
    Location
    Michigan, USA
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook message from Excel

    Thanks. I'll give it a try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •