Solved

vbcrlf in Outlook Redemption RDOMail object Body

Posted on 2009-05-11
3
1,026 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

747 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

12 Experts available now in Live!

Get 1:1 Help Now