Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Outlook mail from Excel
Hi,
someone can help me, now i am using follow code for outlook mail, next i want use this code with selected range like C1:E50 (but in this code i don't want use--Bonus = Format(cell.Offset(0, 1).Value, "$0,000."), i still want use cell A=customer name & cell B=maill address where i want send mails and range would be C1:E50 hope you could understand ------------------------------------------------------------- Sub SendEmail() Dim cell As Range Dim Subj As String Dim EmailAddr As String Dim Recipient As String Dim Bonus As String Dim Msg As String Dim HLink As String For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstant s) If cell.Value Like "*@*" Then 'Get the data Subj = "Your Annual Bonus" Recipient = cell.Offset(0, -1).Value EmailAddr = cell.Value Bonus = Format(cell.Offset(0, 1).Value, "$0,000.") 'Compose message Msg = "Dear " & Recipient & "%0A" Msg = Msg & "%0A" & "I am pleased to inform you that your annual bonus is " Msg = Msg & Bonus & "%0A" Msg = Msg & "%0A" & "Lubna Tufail" Msg = Msg & "%0A" & "President" 'Build hyperlink HLink = "mailto:" & EmailAddr & "?" HLink = HLink & "subject=" & Subj & "&" HLink = HLink & "body=" & Msg 'Send it ActiveWorkbook.FollowHyperlink HLink Application.Wait (Now + TimeValue("0:00:02")) SendKeys "%s", True End If Next End Sub ---------------------------------------------------------------- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
e-mail from excel when outlook is not in use | Excel Discussion (Misc queries) | |||
How can I use Outlook express to send mail rather than Outlook by VBA code | Excel Programming | |||
How can I use Outlook express to send mail rather than Outlook by VBA code | Excel Programming | |||
Excel open an Outlook e-mail? | Excel Programming | |||
Display mail application either in Outlook, or Outlook express | Excel Programming |