Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Cell.getCharacters() and Cell.setCharacters() methods. These methods will return and accept an array of FontSetting objects, which you can use to access and update various properties of a font, such as font name, font color, boldness, etc.
The following code demonstrates the usage of Cell.getCharacters() and Cell.setCharacters() methods using the source Excel file, which you can download from the provided link. The source Excel file contains rich text in cell A1. It has three portions, each with a different font. We will access these portions and update the first portion with a new font name. Finally, it saves the workbook as the output Excel file. When you open it, you will find that the font of the first portion of the text has changed to “Arial”.
Here is the console output of the above sample code using the source Excel file.
Before updating the font settings....
Century
Courier New
Verdana
After updating the font settings....
Arial
Courier New
VerdanaAnalyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.