I have written code in vb .net that uses outlook.taskitem. I create my body part using my data which is stored in a string.
When using outlook 98 the formatting is fine in the body of the task created in the public folder, but when I upgrade to Oulook 2003, the body of the task also shows the formatting i.e. {\rtf1\ansi etc.
What is the best way to overcome this

Send RichTextBox (RTF Text) contents in Outlook email item
Dolphins
Actually, according to the code you have, I would expect to see the RTF encoding in the resulting message (for example: {adsfadf\;fcharset0...). Just setting the olBodyFormat property is not enough. You need a way to get the RTF content into the message. You have a few options, the popular of which is using the third party library from Redemption: http://www.outlookcode.com/d/formatmsg.htm
This will give you what you need.
John.
Vinayak
Hi
I am trying to get the contents of a RichTextBox , in a new email item using Outlook 2003
The following code gives me unexpected results !!! , the RTF ecoding is dumped into the email window !
What I need is to insert the formated text as the body of the email.
using
Word = Microsoft.Office.Interop.Word;using
Outlook = Microsoft.Office.Interop.Outlook;// a part of some class
private void SendEmailUsingOutLook(string rtfBody){
Application outlookApplication = new Microsoft.Office.Interop.Outlook.Application();Outlook.
MailItem email =(Outlook.
MailItem)outlookApplication.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem); email.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatRichText;email.Body = rtfBody;
email.Display(
false);}
private void button2_Click(object sender, EventArgs e){
this.RichTextBox1.Rtf);}
thrantir
AlexTorone
Can you show how TO paste document in the message.body
e.g
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.Application") ' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Dim objApplication As Word.Application
Dim objWord As Word.Document
Set objApplication = New Word.Application
Set objWord = objApplication.Documents.Open("abcDoc.rtf")
objWord.Select
objWord.Range.Copy
With objOutlookMsg
.To = strMailTo
.Subject = "Subject"
.bodyformat=olFormatRichText
.BODY = objWord.Content <<< Gives me unformatted text
message.paste() How to write this
lou_1
I have been able before to use the Clipboard t odo a similar thing, I had a word document and need to send its content via email.
I remember doing somthing like that :
doc.WholeStory.Copy();
message.paste();
I am not sure if this will work with RichTextBox or not ....
richTextBox1.Copy();
message.paste();
I will try to find what I did before,then back again to you soon
TomPonent