Page 1 of 1

Problem with Copying Table to Clipboard

Posted: Wed Dec 03, 2008 12:44 pm
by absolutebeginner
Hi,

I'm just evaluating TRichViewEdit and I have a problem with the 'Color' property of the table when copying the table as RTF via clipboard to Microsoft Word.

Here is my example code:

Code: Select all

Editor.Clear;

  T1 := TRVTableItemInfo.CreateEx(1,2, Editor.RVData);
  T1.Color := clGreen;
  T1.Cells[0,0].Clear;
  T1.Cells[0,0].Color := clLime;
  T1.Cells[0,0].AddNL('H1', 0, 0);
  T1.Cells[0,1].Clear;
  T1.Cells[0,1].Color := clLime;
  T1.Cells[0,1].AddNL('H2', 0, 0);
  Editor.AddItem('', T1);

  Editor.Format;
  Editor.SelectAll;
  Editor.CopyRTF;
When creating the table I see two lightgreen cells with darkgreen border in TRichView Edit.

When I paste the stuff in Microsoft Word then the darkgreen color is gone.
I can only see the lightgreen cells surrounded with a white border on white ground. :cry:

Any ideas?

Gary

Posted: Wed Dec 03, 2008 7:04 pm
by Sergey Tkachenko
This is a limitation of MS Word (and RTF format).
It does not support a background table color. It only supports colors of cells and borders.

Posted: Wed Dec 03, 2008 7:08 pm
by absolutebeginner
Hi Sergey,

thanks for the fast answer.

That's of course not that, that I would like to hear 'cause this disturbs my complete table layout.

But I guess I have to live with it and make some re-arrangements in the layout.

Gary