Page 1 of 1

Setting text style to selected text in a table/cell

Posted: Thu Feb 08, 2007 2:28 am
by luvcloud_say
Hi,

How do i change the text style (font name, bold, italics..) of text in a table item?

Let me explain the flow:
I will first insert an rtf text into a cell in a table using LoadRTFFromStream:
l_RVTableItemInfo.Cells[0, 0].LoadRTFFromStream(l_Stream);

The rtf text contain unicode characters, and as such, i need to set the RTFReadProperties.TextStyleMode to rvrsAddIfNeeded. If not, the text displayed will be in funny characters

Then what i need to do is to remove all text formatting that is contained in the rtf text i just inserted. So how do i do that? Is there a function similar to SetParagraphStyleToAll. Is there a way for me to change the text style for the table item? Thanks

Posted: Thu Feb 08, 2007 8:54 am
by Sergey Tkachenko
What do you mean be removing all formatting? Assigning the same text style to all loaded text?
May be you can do it on RTF loading.
Try the following settings:
1) Create Unicode text style;
2) RichViewEdit1.RTFReadProperties.UnicodeMode := rvruOnlyUnicode;
3) RichViewEdit1.RTFReadProperties.TextStyleMode := rvrsUseSpecified;
4) RichViewEdit1.RTFReadProperties.TextStyleNo := index of text style created on the Step 1.

Since the import will be in Unicode mode, funny characters must not appear.

Posted: Fri Feb 09, 2007 12:39 am
by luvcloud_say
ahh..I know why it still showed funny characters even after i did the steps u listed. I didn't realize there was another Unicode property i need to set to True under the TextStyles items in the TRVStyle component.

It's working fine now. Thanks!