Hi,

I want to set up document into my richedit box, but it does not like as I want.

From begin:
I've create document into microsoft word. Document have cells and looks like I want. Now I've wrote it as RTF document (formatted). Now to test it I opened it into wordpad. It looks like too.
Write as anoter name into wordpad created 2x smaller document but still looked as OK into wordpad and microsoft word.

Now I've create resource file with dialog and richeditbox:
CONTROL "Rich Edit", IDC_RICHEDIT1, RICHEDIT_CLASS, WS_TABSTOP | WS_HSCROLL | WS_VSCROLL | WS_BORDER | ES_CENTER | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY, 7, 7, 455, 229

Now I read RTF text, allocate memory, replace some elements into text and send to control:
SETTEXTEX sx;
sx.flags = ST_DEFAULT;
sx.codepage = CP_ACP;
SendMessage(hDlg,EM_SETTEXTEX,(WPARAM)&sx,(LPARAM)data);

Where data contains RTF text. Dislplayed data was diffrient as expected. Looks like text leaves the cells. I don't know how I can change it.
When I same "data" after modyfication to file and open into word/worpad then looks like I want.

I've found similar problem this: http://bytes.com/groups/net-c/244588-richtextbox-tables

and 2 screenshots:
http://www.coredumped.de/pics/rtf-good.jpg
http://www.coredumped.de/pics/rtf-bad.jpg

Same as my

In my code I have too: LoadLibrary("Riched20.dll");