We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Access and format single characters of a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

67906 Sep 4,2007 10:30 AM Oct 17,2007 04:36 AM Windows Forms 3
loading
Tags: XlsIO
Christian Nein
Asked On September 4, 2007 10:30 AM

Hi,

does XlsIO offer the functionality to access and format single charcters of a Range like this is possible in MS Excel by Range.Characters() (Range.get_Characters() when using Interop assemblies)? I did not find the corresponding function in XlsIO.

We urgently need this feature as we have to set different fonts for different characters within one cell string.

Thanks in advance & best regards
Christian

Melba Winshia [Syncfusion]
Replied On September 5, 2007 08:17 AM

Hi Christian,

Thank you for your interest in Essential XlsIO.

You can format single character of a Range by using IRange.RichText property. But we do not have any similar API Range.Characters() as in MS Excel. If your intention is to get characters of a Range, it can be achieved by using IRange.Text.ToCharArray() method. Please use the below code snippet to set different fonts for different characters within one cell string.

[C#]

//Insert Rich Text
IRange range = sheet.Range["A1"];
range.Text = "RichText";
IRichTextString rtf = range.RichText;

//Formatting first 4 characters
IFont redFont = workbook.CreateFont();
redFont.Bold = true;
redFont.Italic = true;
redFont.RGBColor = Color.FromArgb(0xde, 0x64, 0x13);
rtf.SetFont( 0, 3, redFont );

Please refer to the samples that are shipped with Essential XlsIO to get more details regarding this issue that is found in below location.

C:\Documents and Settings\melbas\My Documents\Syncfusion\EssentialStudio\5.1.0.51\Windows\XlsIO.Windows\Samples\2.0\Rich Text\WriteRichText\cs

Please try this and let me know if this helps.

Thanks,
Melba

Christian Nein
Replied On September 10, 2007 09:36 AM

Hi Melba,

this works great! Thank you very much for supporting.

Best regards
Christian

Melba Winshia [Syncfusion]
Replied On October 17, 2007 04:36 AM

Hi Christian,

Thank you for the update.

Glad to hear that it works fine.

Please let me know if you have any other questions.

Thanks,
Melba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;