Consulting

Results 1 to 6 of 6

Thread: email + no pop up warning message?

  1. #1

    email + no pop up warning message?

    I have a script to send out emails through excel to people and so far I have several issues:
    1) If I try to automatically send without displaying the message itself, I get a warning asking me to confirm that I actually want to do this. How do I remove this?
    2) Sending email without displaying it first interprets CSS that I use to style the message as text, rather than code. This happens only if I send the message WITHOUT displaying it first. Is this a bug?

    Here's a basic example of my code:
    [VBA]Sub Macro3()
    Dim Outlook As Object, NewMail As Object

    Set Outlook = CreateObject("Outlook.Application")
    Set NewMail = Outlook.CreateItem(olMailItem)

    With NewMail
    .To = "xxx@xxx.com"
    .subject = "my subject"
    .BodyFormat = olFormatHTML
    .HTMLBody = "message"
    .Display
    '.send
    End With
    End Sub[/VBA]

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location

  3. #3
    Should you be locked out of CDO, there is a product called Outlook Redemption which avoids the warning. It must be installed on all systems that use the code however. http://www.dimastr.com/redemption/
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  4. #4
    This is perfect, thank you.

  5. #5
    Hmm, I get compile error: "expected: =".
    here's how I use it:
    [VBA] CDOMail_SendMessage (SendTo:=crew.Email, SendCC:="", SendBCC:="", _
    From:="Accounting", ReplyTo:="DoNotReply@cleanway.com", _
    Subject:="Subject", BodyHTML:="body", BodyPlain:="")[/VBA]
    Does anyone know why?

  6. #6
    Remove the () brackets
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

Posting Permissions

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