LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Help Using Excel 2003 to send emails

This piece of code worked fine when I was on Office 2000. Now I've
upgraded to 2003 I am struggling with the below if the length of
lsMailTo is longer than 1033 characters (what a strange number)

psBody = "Hello " & gsFirstName & vbCr & vbCr & psBody & _
vbCr & vbCr & "Regards,"

lsMailTo = _
"mailto:" & gsEmailAdd & _
"?subject=" & HexString(gsSubject) & _
"&body=" & HexString(psBody)


ActiveWorkbook.FollowHyperlink lsMailTo


Function HexString(psStr) As String

Dim liIndex As Long
Dim lsChar As String
Dim lsHex As String


For liIndex = 1 To Len(psStr)
lsChar = Mid(psStr, liIndex, 1)

If IsNumeric(lsChar) Or IsChar(lsChar) Then
HexString = HexString + lsChar
Else
lsHex = Hex(Asc(lsChar))

If Len(lsHex) = 1 Then
lsHex = "0" & lsHex
End If

HexString = HexString + "%" + lsHex
End If
Next

End Function


My code is probably overkilling which characters need to be converted to
hex (e.g. a comma would definately cause a run time error) but I am
curious to get this working please

--
Mike News
 
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
Excel send emails jc132568 Excel Worksheet Functions 1 September 22nd 08 09:24 PM
Programming Excel to send emails Karl Excel Programming 1 November 2nd 07 10:53 AM
Help! trying to send emails through excel [email protected] Excel Programming 2 May 8th 07 01:23 AM
Can Excel send out emails? Robert Hodge Excel Discussion (Misc queries) 1 January 10th 06 10:11 AM
Can you tell Excel to send emails through Outlook? Donald S Excel Discussion (Misc queries) 1 June 30th 05 05:21 PM


All times are GMT +1. The time now is 07:39 PM.

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

About Us

"It's about Microsoft Excel"