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

  • Thread starter Thread starter Rank
  • Start date Start date
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)
 
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
 
Back
Top