473,791 Members | 2,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#, formatting RTF into an Outlook e-mail

15 New Member
I need to be able to put the contents of a RichTextBox, including formatting and images, into a new Outlook e-mail. So far, the results I have are either that I lose all formatting and keep only the text, or get the text of all the RTF formatting - neither of which are acceptable.

The code I'm using is below:

Outlook.Applica tion outlookApp = new Outlook.Applica tion();
Outlook.MailIte m email = (Outlook.MailIt em)outlookApp.C reateItem(Micro soft.Office.Int erop.Outlook.Ol ItemType.olMail Item);
email.Body = rtfReader.Rtf;

email.BodyForma t = Microsoft.Offic e.Interop.Outlo ok.OlBodyFormat .olFormatRichTe xt;
email.Display(f alse);


Using third-party libraries is not an option, so I would appreciate it if using Redemption or otherwise are not suggested as solutions. I know they exist. I cannot use them.

What I need is a starting point for solving this problem. I am confident that I am capable of coding a solution, but I don't know where to begin or how to go about doing it. Any assistance is greatly appreciated. <3
Nov 1 '07 #1
0 2111

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3757
by: Tom Petersen | last post by:
I am using a response.write to test the formatting of the output. I am supposed to get this: BEGIN:VCALENDAR VERSION:1.0 BEGIN:VEVENT DTSTART:20051022T090000Z DTEND:20051022T090000Z LOCATION;ENCODING=QUOTED-PRINTABLE:Library UID:20051022T090000ZI-request DESCRIPTION;ENCODING=QUOTED-PRINTABLE:test
6
1740
by: Tom Petersen | last post by:
Here is a little more info, sorry should have explained what my final goal was. I am creating a .vcs file from a form to import into Outlook. I was just testing the output on screen then pasting that into a file, after removing the extra white space, and inserting line breaks. The data is valid, but the formatting into the file isn't working. Was I doing the formatting right if I was generating a file? I need it to create the .vcs...
2
2196
by: Giganews | last post by:
I am currently working on an Outlook automation module in an Access 97 database. All is working well except now the client wants the generic email body to contain certain sections in red text and others in blue text. Can this be done? If so how? I understand that I may have to send this email in HTML format which is not a problem. Any help would be much appreciated. Mark
1
1543
by: thoemmes | last post by:
I am trying to use the following code to create an email message which takes its body from values stored in a form. I want to split the values up so I have added some line breaks to strBody. These work in acccess but as soon as they are transferred to outlook they disapear. Is there a way to keep formatting while transferring to outlook? TIA Private Sub Command159_Click()
4
3236
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
3
6222
by: washoetech | last post by:
I have a gridview control. In this grid view there is a column for the price of an item. Some of the prices have a dollar sign in front of it and some dont. How do I get rid of the dollar sign if it is in front of the value? My guess would be to use a template column but I dont know how to go about this. Any ideas? Below is an example of what the data looks like raw from the database: $456.95 200.89
8
9181
by: G.Ashok | last post by:
Hi, I have created CultureInfo object and specified required digit grouping in it. The one of the overloaded ToString methods of Decimal type has parameters to format the value with required custom format and a IFormatProvider. I pass a custom format string for positive, negative and Zero (3 sections) and CultureInfo object containing the required DigitGrouping as IFormatProvider. But ToString is not formatting the value using the digit...
5
1562
by: Shimon Sim | last post by:
I just don't understand what is wrong. I have simple query. One of the returning fields is data I created bound column for GridView (ASP.NET 2.0) and specified DataFormatString as {0:d} - it returns me the row date with hours. I tried something like this {0 :dd/MM/yyyy} the same results. It looks like that system doesn't recognize that the field is date. Why not? What can be done? Thank you,
4
2619
by: Nalaka | last post by:
Hi, I have two questions about gridViews. 1. How can I intercept the row/column values at loading to change values? 2. After I update a row (using default update functionality), how can I re-format the updated row fields. I have looked at gridView.rowUpdated method, but cannot figure out how....
1
1987
by: Rob | last post by:
Hey folks, I should be ashamed for not knowing the answer to this question - but I don't get the opportunity to program all that much anymore... I have a data tracking program used by over 150 users (not all at once) and works with no problems. Every once in a while,I add some functionality. When the user updates a record,I want Access to send the next individual in the chain an email telling them it is their turn to due the update....
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.