Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Change

    .Send

    to

    .Display

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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..

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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!

Posting Permissions

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