Thread: [Solved] Send e-mail by macro
View Single Post
 
Old 04-11-2012, 07:52 AM
plamenbv plamenbv is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Apr 2012
Posts: 1
plamenbv is on a distinguished road
Default Send e-mail by macro

I want to do something in Excel, but dunno if it's possible. I want to create a Workbook, that contains two columns - column A is "Points" and column B is "E-mail Adress". Well, I need a macro to send the points from column A to the mail adress in column B. I made one, but it's for 1 row only and I need it for about 2000 rows. Here's the code of the macro I made:

Code:
Sub SendEMail()
    Dim Email As String, Subj As String
    Dim Msg As String, URL As String
        
        Email = Cells(1, 2)
        
'       Message subject
        Subj = "Something"

'       Compose the message
        Msg = ""
        Msg = Msg & Cells(1, 1)

'       Create the URL
        URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg

'       Execute the URL (start the email client)
        ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus

End Sub
Reply With Quote