Problem with Copying Table to Clipboard

General TRichView support forum. Please post your questions here
Post Reply
absolutebeginner
Posts: 2
Joined: Wed Dec 03, 2008 9:30 am

Problem with Copying Table to Clipboard

Post 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
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
absolutebeginner
Posts: 2
Joined: Wed Dec 03, 2008 9:30 am

Post 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
Post Reply