RTF errors

What usually happens

The RTF format certainly is microsoft's best creation. It is well documented, but its biggest drawback is that it does not allow any tiny error in the syntax.

First, it uses opening and closing brackets : { and } to structure blocks.

At the end of the file, there must be exactly the same number of each kind of brackets.

So far, this has always been the problem I have encountered when word refused to open a file.

Now if Word opens the file but crashes, the problem is more difficult. Generally it has to deal with tables. I have already encountered only the following errors :

In these cases, you have to find those discrepancies and correct them by hand...

A close-up on tables

First, RTF deals with rows, not tables.

Word reconstitutes the table from the rows when opening the RTF file.

an example of 2 rows, 2 columns :

  \trowd \trgaph70\trleft-70 \cellx4536\cellx9142 \pard\plain
  \widctlpar\intbl \f4\fs20\lang1036 Row 1 column 1\cell Row 1 column 2\cell
  \pard \widctlpar\intbl \row 
  \trowd \trgaph70\trleft-70 \cellx4000\cellx9000 \pard \widctlpar\intbl Row
  2 column 1\cell Row 2 column 2\cell \pard \widctlpar\intbl \row
  \pard \widctlpar 

explanations :

  \trowd : a row begins
  \cellx : length of the cell (= numbers following)
  \cell : indicates the end of a cell
  \row : the row ends
  \intbl : must follow any paragraph declaration (pard) inside a cell

See the first row again with explanations

(between /* */, it's not an RTF syntax !)

\trowd \trgaph70\trleft-70 \cellx4536\cellx9142

/* comment : there, the description of the first row ends */

/* this row has two cells ending at coordinate 4536 and 9142 */

\pard\plain \widctlpar\intbl \f4\fs20\lang1036 Row 1 column 1\cell

/* content of the first cell is the text : " Row 1 column 1 " */

Row 1 column 2\cell

/* content of the 2nd cell is the text : " Row 1 column 2 " */

\pard \widctlpar\intbl \row

/* end of the row, must be preceded by \pard \intbl */

If the numbers of cellx's and cell's don't match in a row... boom.

Yves
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yves SAGNIER                       " ICEBERG " 
Centre d'Etudes de la Navigation Aerienne (CENA)
1-9, rue Champagne, 91200 Athis-Mons, FRANCE
Tel :   [33] 01 69.57.70.91  Fax : [33] 01 60 48 70 20
E-mail : SAGNIER_Yves@cena.dgac.fr
URL : http://www.cena.dgac.fr/~sagnier/
" Tomorrow will bring happiness or at least another day " (Phil Ochs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~