Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
e-mail from excel when outlook is not in use Jignesh Khandwala Excel Discussion (Misc queries) 5 April 7th 06 09:52 AM
How can I use Outlook express to send mail rather than Outlook by VBA code new.microsoft.com Excel Programming 5 August 3rd 05 03:45 PM
How can I use Outlook express to send mail rather than Outlook by VBA code new.microsoft.com Excel Programming 1 August 1st 05 12:45 PM
Excel open an Outlook e-mail? Lawson Wentworth Excel Programming 2 June 5th 05 12:53 PM
Display mail application either in Outlook, or Outlook express [email protected] Excel Programming 0 April 13th 04 09:50 PM


All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"