email text with utlok express. format problem

T

touf

Hi,
I'vea function that create an email using the default mail program, to
format the text I use the function "ReplaceSpecialCharacters" found in the
link http://www.vb-helper.com/howto_launch_email.html

This works with Outlook, but if the default mail program is outlook express
this function doesn't work. It create the email text as one paragraphe.
here is the function:

Private Function ReplaceSpecialCharacters(ByVal txt As _
String) As String
Dim i As Integer
Dim ch As String
Dim result As String

For i = 1 To Len(txt)
ch = Mid$(txt, i, 1)
If (ch < " ") Or (ch > "~") Or (ch = "&") Then
' Replace with hex code.
ch = Right$("00" & Hex(Asc(ch)), 2)
result = result & "%" & ch
Else
' Leave unchanged.
result = result & ch
End If
Next i

ReplaceSpecialCharacters = result
End Function

Any help please?
 
H

Herfried K. Wagner [MVP]

* "touf said:
I'vea function that create an email using the default mail program, to
format the text I use the function "ReplaceSpecialCharacters" found in the
link http://www.vb-helper.com/howto_launch_email.html

This works with Outlook, but if the default mail program is outlook express
this function doesn't work. It create the email text as one paragraphe.
here is the function:

Have a look at 'HttpUtility.UrlEncode'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top