Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Mar 2007
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Document Close (Word 2003 SR1)

    <P ID="edit" class=small>(Edited by rory on 14-Jun-07 09:56. Edited to obscure the real email address!)</P>Hi All

    I am trying to have a document emailed when it is closed and the recipient name put in. I have the emailing part working but it is not filling in the name, can anyone shed any light on why this might be happening - the code I am using is

    Private Sub Document_Close()
    If MsgBox("Do you want to e-mail the document?", _
    vbQuestion + vbYesNo) = vbYes Then
    With ActiveDocument.MailEnvelope
    .Introduction = "Please find attached the meeting request form."
    .Item.Recipients.Add "joe.bloggs@somecompany.co.uk"
    End With
    Options.SendMailAttach = True
    ActiveDocument.SendMail
    End If
    End Sub
    Thanks in advance

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

    Re: Document Close (Word 2003 SR1)

    As I already pointed out in <post:=653,408>post 653,408</post:>, adding recipients doesn't work with SendMail. See How to send an email from Word using VBA for alternatives.

Posting Permissions

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