Results 1 to 15 of 15

Opens Outlook from Excel using VBA and send emails

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Opens Outlook from Excel using VBA and send emails

    Hi,

    I have the following code, and while it is working, but I would like to tweak it around to suit my needs:

    Private Sub EmailtoTeam_Click()
    ' This example sends the last saved version of the Activeworkbook object .
        Dim OutApp As Object
        Dim OutMail As Object
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
    
        On Error Resume Next
       ' Change the mail address and subject in the macro before you run it.
        With OutMail
            .To = "[email protected]"
            .CC = ""
            .BCC = ""
            .Subject = "test"
            .Body = "Hello World!"
            .Attachments.Add ActiveWorkbook.FullName
            .Send
        End With
        On Error GoTo 0
    
        Set OutMail = Nothing
        Set OutApp = Nothing
    End Sub
    What I want:

    Have the macro open up an instance of Outlook and manually fill in what goes in the body. The recipient's email address and the subject lines can use what's in the code above.

    The code will send the current active workbook out as an attachment, and I would like to keep this feature.

    Is this doable via a macro?

    Thanks
    Last edited by Lifeseeker; 02-10-2012 at 03:42 PM.

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