VBScript -> Item.Body -> No carriage return char

R

Rank

Hi everyone!
:)

I'va made a VBScript in a Task form who create e new email when you check
'completed' on the task...

This script copy the body of the task in the body of the mail ( NewMail.Body
= Item.Body ) but the body is losing all of the carriage return chars....

So, what should I do??


Thank you all and have a nice day!
:)

-Rank



Code:

Function Item_Write()
if Item.Complete then
Set NewMail = Application.CreateItem(0)
NewMail.To = "*************"
NewMail.Subject = Item.Subject
NewMail.Body = Item.Body
NewMail.Display
end if
End Function

Using Outlook 2000 (9.0.0.3821) on Windows 2000 Server (5.00.2195)
 
M

Munsifali Rashid

The email message format might be html. Try changing the the email message
type to plain text, or replace carriage returns in the email message with
line breaks.

To change the item to plain text, I think you might need to change the
..BodyFormat property - I'm not sure off-hand. To replace the body with line
breaks, use the following code:

NewMail.Body = Replace(Item.Body, vbCrLf, "<br>")

Hope this helps,

Mun
 

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