String format inside a cell

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
MaxChan
Posts: 19
Joined: Sat Sep 03, 2016 6:38 am

String format inside a cell

Post by MaxChan »

Hi, I am able to change the format of the whole cell.

How to change the format inside the cell? I want to BOLD some words in the cell, not all the words within that cell.
Eg:
Cell 1,1 contains below.
(bold Description): TEST
(bold Model): ABC
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: String format inside a cell

Post by larsa »

Hello

You can use AsSimpleTags

Example

Code: Select all

    //* AsSimpleTags let you easily create formatted text with html-like tags.
    //* There are no end tags. A tag sets an option, and that option is used
    //* until a new tags replaces it. In order to write the "<", character,
    //* write an empty tag "<>" in the text. Example: 'Two <> one'
    //* The following tags can be uses:
    //*  <b>  Turn bold on.
    //* </b>  Turn bold off.
    //*  <i>  Turn italic on.
    //* </i>  Turn italic off.
    //*  <u>  Turn underline on.
    //* </u>  Turn underline off.
    //* <f:Font name> Changes the font name.
    //* <s:nn> Changes the font size. Setting the size to zero sets the font size to the default size.
    //* <c:xxxxxx> Changes the font color. The value xxxxxx is the hexadecimal RGB color value.
    //*            If xxxxxx is set to 'Auto', the default color will be used.

  XLS[0].AsSimpleTags[1,1] := 'Normal <b>Bold</b> <i>Italic</i> <c:0000FF>Red</c>';
Lars Arvidsson, Axolot Data
MaxChan
Posts: 19
Joined: Sat Sep 03, 2016 6:38 am

Re: String format inside a cell

Post by MaxChan »

Thanks!

I tested, it only accept 1 format, right?
when I apply this '<b><u>GENERAL DESCRIPTION:</u></b> '

I only got underline applied.

Thank you very much!
Post Reply