Setting text style to selected text in a table/cell

General TRichView support forum. Please post your questions here
Post Reply
luvcloud_say
Posts: 5
Joined: Thu Feb 08, 2007 12:50 am

Setting text style to selected text in a table/cell

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

Post 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.
luvcloud_say
Posts: 5
Joined: Thu Feb 08, 2007 12:50 am

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