+ Reply to Thread
Results 1 to 2 of 2

Automatically EMailing a Spreadhsheet Upon Opening

  1. #1
    Rod
    Guest

    Automatically EMailing a Spreadhsheet Upon Opening

    I have a spreadsheet I would like to automatcially email itself upon opening.
    It will always go to the same address. I use MS Outlook and Excel 2003. Is
    this possible?

    I am comfortable w/ Excel and Outlook put am not an accomplished programmer.
    Is there help out there?

    Thanks.

  2. #2
    Bernie Deitrick
    Guest

    Re: Automatically EMailing a Spreadhsheet Upon Opening

    Rod,

    Put the code below into a module (making changes as needed to the subject,
    address, and message), set a reference to MS Outlook using Tools |
    References.... and use the open event or an auto-open macro to run it.

    HTH,
    Bernie
    MS Excel MVP

    Sub EmailThisWorkBookNow()
    Dim ol As Object
    Dim myItem As Outlook.MailItem
    Dim myMsg As String
    Dim myAtts As Outlook.Attachments

    Set ol = CreateObject("outlook.application")

    myMsg = "Hi Rod," & Chr(10) & Chr(10)
    myMsg = myMsg & "Here's that stupid file.... AGAIN!" & Chr(10) & Chr(10)
    myMsg = myMsg & " Rod" & Chr(10)

    Set myItem = ol.CreateItem(olMailItem)
    myItem.to = "[email protected]"
    myItem.Subject = "Subject Line"
    myItem.Body = myMsg
    Set myAtts = myItem.Attachments
    myAtts.Add ThisWorkbook.FullName
    myItem.Send

    Set ol = Nothing

    End Sub

    "Rod" <[email protected]> wrote in message
    news:[email protected]...
    > I have a spreadsheet I would like to automatcially email itself upon

    opening.
    > It will always go to the same address. I use MS Outlook and Excel 2003.

    Is
    > this possible?
    >
    > I am comfortable w/ Excel and Outlook put am not an accomplished

    programmer.
    > Is there help out there?
    >
    > Thanks.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1