Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel send emails | Excel Worksheet Functions | |||
Programming Excel to send emails | Excel Programming | |||
Help! trying to send emails through excel | Excel Programming | |||
Can Excel send out emails? | Excel Discussion (Misc queries) | |||
Can you tell Excel to send emails through Outlook? | Excel Discussion (Misc queries) |