Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-11-2012, 07:52 AM
plamenbv plamenbv is offline Send e-mail by macro Windows 7 64bit Send e-mail by macro Office 2007
Novice
Send e-mail by macro
 
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
  #2  
Old 04-16-2012, 05:25 AM
macropod's Avatar
macropod macropod is offline Send e-mail by macro Windows 7 64bit Send e-mail by macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Why not use an email mailmerge from Word? No vba required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant Send E-Mail dmack98 Outlook 0 03-09-2012 10:59 AM
outlook does not send mail tril66 Outlook 1 01-20-2012 02:36 PM
Macro for sending mail and opening the sent mail afterwards Rumlegok Outlook 0 09-20-2011 07:27 AM
Send Mail from Project using VBA OTPM Project 0 05-24-2011 03:35 AM
Send e-mail by macro send/receive mail every 5 min.? bsoderror Outlook 2 07-06-2009 04:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft