String format inside a cell

Questions and answers on how to use XLSReadWriteII 5.

String format inside a cell

Postby MaxChan » Thu Sep 21, 2017 4:01 pm

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
MaxChan
 
Posts: 16
Joined: Sat Sep 03, 2016 6:38 am

Re: String format inside a cell

Postby larsa » Tue Sep 26, 2017 12:35 pm

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
larsa
Site Admin
 
Posts: 602
Joined: Mon Jun 27, 2005 9:30 pm

Re: String format inside a cell

Postby MaxChan » Thu Oct 05, 2017 7:32 am

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!
MaxChan
 
Posts: 16
Joined: Sat Sep 03, 2016 6:38 am


Return to XLSReadWritwII 6

Who is online

Users browsing this forum: No registered users and 1 guest