|
-
Jun 22nd, 2006, 08:36 AM
#1
Thread Starter
New Member
Having problems opening email message from Visual Basic 5
Hi all 
I'm using the below function, to open a new email message, and feed in an email address, subject and a 'body' of the email (Note I don't want to send an email, just open the message and paste in contents)...
VB Code:
Public Function OpenEmail(ByVal EmailAddress As String, _
Optional Subject As String, Optional Body As String) _
As Boolean
Dim lWindow As Long
Dim lRet As Long
Dim sParams As String
sParams = EmailAddress
If LCase(Left(sParams, 7)) <> "mailto:" Then _
sParams = "mailto:" & sParams
If Subject <> "" Then sParams = sParams & "?subject=" & Subject
If Body <> "" Then
sParams = sParams & IIf(Subject = "", "?", "&")
sParams = sParams & "body=" & Body
End If
lRet = ShellExecute(lWindow, "open", sParams, _
vbNullString, vbNullString, SW_SHOW)
OpenEmail = lRet = 0
End Function
The problem is, I want to feed a 'body' of text that includes returns after each line of text. As it stands, it just feeds one long line of text, containing company name, phone number etc. I've tried VbCrlF, Sendkeys to send tabs to the email message etc, nothing seems to work.
It just pastes a huge long line of information. I've tried putting vbCrLF's at the end of the strings that are grouped together (with '&') to form the final body string etc, no go...
Any ideas? I'm using VB5 to do this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|