• Previewing a email before sending

    Author
    Topic
    #462949

    I use the code below to automatically send an email when the user presses a button on my form. They now want to preview the email and then hit send in outlook. I know .send is the command for auto sending but what would i use the have them preview the email first? Thanks..

    If Me.EmailType = “No HD Ticket” Then

    On Error GoTo ErrHandler

    Set objDoc = objWord.Documents.Open(“f:nohdticket.doc”)
    With objDoc.MailEnvelope.Item
    .To = Nz(srt, “”)
    .Subject = strSubject
    .SentOnBehalfOfName = “hdassist@ima.com”
    If bSite = False Then
    .Attachments.Add “f:hdReport.rtf”, olByValue, 1, “CPRReport_rpt.rtf”
    End If

    .Attachments.Add “f:tipsheett.pdf”, olByValue, 1, “STN Contact List”

    .Send

    Viewing 1 reply thread
    Author
    Replies
    • #1179967

      Change

      .Send

      to

      .Display

    • #1179970

      That didn’t seem to work. It looks like it is sending the email but it’s not actually sending anything. A message box comes up and sys now outputting my attachments but when I check the sent box nothing is actually sent. Any thoughts? Thanks..

      • #1179974

        I’m sorry, my mistake. I didn’t look carefully enough at your original question. The Display method is for Outlook, but you’re in Word.

        You have to make sure that the Word.Application object is visible:

        objWord.Visible = True

        then instead of .Send use

        objDoc.ActiveWindow.EnvelopeVisible = True

        Obviously, you should not close objDoc or quit objWord after this – the document would disappear from the screen!

    Viewing 1 reply thread
    Reply To: Previewing a email before sending

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: