Thread: Repost
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 408
Default Repost

I think I tracked down the problem, too many characters. If I change "N8" to
a cell with less characters in it, it will work.
Any work around?

Thanks


Sub Mail_Text_in_Body()

Dim msg As String, cell As Range
Dim Recipient As String, Subj As String, HLink As String
Dim Recipientcc As String, Recipientbcc As String
Recipient = "
Recipientcc = ""
Recipientbcc = ""

Subj = "Statement for " & Sheets("Employee List").Range("P2").Value & "
for Incident " & Sheets("Employee List").Range("P3").Value

msg = "Dear customer" & vbNewLine & vbNewLine
For Each cell In Sheets("Employee List").Range("N8")
msg = msg & vbNewLine & cell
Next cell
msg = WorksheetFunction.Substitute(msg, vbNewLine, "%0D%0A")

msg = WorksheetFunction.Substitute(msg, vbLf, "%0D%0A")
HLink = "mailto:" & Recipient & "?" & "cc=" & Recipientcc & "&" & "bcc="
& Recipientbcc & "&"
HLink = HLink & "subject=" & Subj & "&"
HLink = HLink & "body=" & msg

ActiveWorkbook.FollowHyperlink (HLink)
Application.Wait (Now + TimeValue("0:00:05"))
Application.SendKeys "%s"
End Sub



"Dave Patrick" wrote:

Nice. Thank you Ron

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Ron de Bruin" wrote:
| More Excel examples for CDO are here
| http://www.rondebruin.nl/cdo.htm
|
|
| --
| Regards Ron de Bruin
| http://www.rondebruin.nl