Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8612413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:37:12+00:00 2026-06-12T04:37:12+00:00

MS Exchange / Outlook messages store data using MAPI. One common MAPI property contains

  • 0

MS Exchange / Outlook messages store data using MAPI. One common MAPI property contains a rich text version of the message’s body (0x1009, PR_RTF_COMPRESSED, PidTagRtfCompressed). If the rich text string has an invalid structure, then Outlook 2003 and earlier fail to display any body content.

For instance, this RTF code omits a closing “}”.

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 asdfasdf\par

The correct version is

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 asdfasdf\par
}

Are there .NET methods or libraries that I can use to test whether RTF code is valid? If not, I am open to C++ and Java or COM libraries. If not, are there applications that report irregularities in RTF strings?

The ideal solution would report the line numbers containing irregularities. An adequate solution would report whether the RTF as a whole is valid and well formed.

This issue is relevant outside of MAPI. For instance, if the invalid RTF string specified above is written to a .RTF file, it opens correctly in WordPad 5.1, but Word 2007 reports an error and requests that I repair the file.


One suggestion was that I stream the RTF into a rich text box. I tried this code:

private void button1_Click(object sender, EventArgs e)
        {
            string aaa = richTextBox1.Rtf;
            richTextBox1.Rtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 asdfasdf\par}";
            richTextBox1.Refresh();
        }

Whether richTextBox1.Rtf ends with “}” or not, the rich text box displays this as its contents:
asdfasdf

The solution I am looking for would report an error when I omit the last “}”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:37:14+00:00Added an answer on June 12, 2026 at 4:37 am

    Why not load the RTF into a hidden RTF control and then stream it out?
    What exactly would set an invalid RTF? I don’t think Outlook ever does that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send a Rich Text Format email message using Outlook 2003.
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Mail; using Microsoft.Exchange.WebServices.Data; namespace Email
How to access Offline Address Book (from exchange server/outlook configured to exchange machine) using
I am using Microsoft.Office.Interop.Outlook in C# to access a mailbox and find messages with
I have a web page driven by data taken from an Exchange server using
I am using Exchange Web Services to try to get a list of all
I'm using Exchange Web Service exposed from exchange 2007 SP1 server to create emails
I am using SmtpClient to send a message through a gmail account, I set
Since Exchange 2007, MAPI is no longer installed when Exchange is installed. On these
Okay, so here is the basic background. This program connects to outlook/exchange and parses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.