Solved

vbcrlf in Outlook Redemption RDOMail object Body

Posted on 2009-05-11
3
1,029 Views
Last Modified: 2013-11-25
I've written some VB code to forward an email message to certain individuals.  I'm using the Outlook Redemption toolset to do this task.  I'm having an issue with the Body of the email.  I want to add my own text with carriage returns and then include the sender's body below.  The vbcrlf command does not seem to be working.  All the body text is one big wrapped string in the Body of the email.

I've tried using the RDOMail's Body property and the RTFBody property with different BodyFormats and without BodyFormat defined.  I've had no luck.  I'm still getting one long wrapped string in the body.

Has anyone run into this issue?  If so, what did you do to resolve the issue?
Public Sub SendEmail(RDORcvdMail As Redemption.RDOMail, MailRecipient As String)

Dim lrdoNotifyMail As Redemption.RDOMail

Dim lstrBody       As String

On Error GoTo ErrorHandler
 

    Set lrdoNotifyMail = RDORcvdMail.Forward

    

    lrdoNotifyMail.To = MailRecipient

    lrdoNotifyMail.Subject = RDORcvdMail.Subject

    lstrBody = "Testing line 1" & vbCrLf & "Testing line 2" & vbCrLf & "Testing line 3" & vbCrLf & RDORcvdMail.Body

    lrdoNotifyMail.RTFBody = lstrBody

    lrdoNotifyMail.Send

    If Not (lrdoNotifyMail Is Nothing) Then

        Set lrdoNotifyMail = Nothing

    End If

    

    Exit Sub

.

.

.

Open in new window

0
Comment
Question by:bcullinan
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 24356216
Hi, bcullinan.

I'm familiar with Redemption, but not with using the RTFBody.  I always use HTML or plain text.  I think the RTF code for a new line is /n, but I'm not certain of that.  Is there a reason why you're using RTF format?  
0
 

Author Comment

by:bcullinan
ID: 24356536
Thank you, BlueDevilFan.  I used HTMLBody with <BR> as the newline command and that worked.
In my debugging, I was using all the Body properties that existed for the RDOMail object with the exception of HTMLBody.  Go figure.

I've found another issue though.  I want the original sender's email body including any images in the signature to be preserved when forwarding the email.  That doesn't look to be possible with HTMLBody.  I may try to send the original message as an attachment instead.

Thanks again for the solution!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24356879
You're welcome.  Glad I could help.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
If you don't know how to downgrade, my instructions below should be helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now