Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    San Francisco, California, USA
    Thanked 0 Times in 0 Posts

    SendMail woes.... (Word 97)


    I was wondering if anyone has been able to accomplish the following (in Word 97, of course):

    Send the current document to a specific recipient with a specific subject line (ie. with sendmail),
    or use a hyperlink to send email (because you can specify recipient and subject) and automatically attach the document.

    This really has me stumped. I was able to do something similar in Excel, but it doesn't seem to be available in Word. Or am I looking in the wrong place?

    Thanks in advance,

    Cecilia <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Hollywood (sorta), California, USA
    Thanked 0 Times in 0 Posts

    Re: SendMail woes.... (Word 97)

    Word 97 (not sure about the others) has a really, really
    wimpy sendmail method. In other words, in the real world it's
    useless. After adding a reference to the Outlook Object
    Library (or dim all objects as Object), try this instead:

    <pre>Sub cmdSendADoc()
    Dim objOutlook As Outlook.Application
    Dim nsMAPI As Outlook.NameSpace
    Dim objOutbox As Outlook.MAPIFolder
    Dim objNewMessage As Outlook.MailItem

    Set objOutlook = New Outlook.Application
    Set nsMAPI = objOutlook.GetNamespace("MAPI")
    Set objOutbox = nsMAPI.GetDefaultFolder(olFolderInbox)
    Set objNewMessage = objOutbox.Items.Add

    If Not ActiveDocument.Saved Then
    End If

    With objNewMessage
    .To = "TheBoss"
    .Subject = "Your custom subject line"
    .Attachments.Add activedocument.fullname
    End With
    Set objOutlook = Nothing
    Set nsMAPI = Nothing
    Set objOutbox = Nothing
    Set objNewMessage = Nothing
    End Sub

    Kevin <IMG SRC= alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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