Access and Update the Portions of Rich Text of Cell with Golang via C++
Contents
[
Hide
]
Aspose.Cells allows you to access and update the portions of the rich text of a cell. For this purpose, you can use Cell->GetCharacters() and Cell->SetCharacters() methods. These methods return and accept an array of FontSetting objects, which you can use to access and update various font properties such as font name, font color, boldness, etc.
Access and Update the Portions of Rich Text of a Cell
The following code demonstrates the usage of the Cell->GetCharacters() and Cell->SetCharacters() methods using the source Excel file (5112369.xlsx). The source Excel file contains rich text in cell A1 with three portions, each having a different font. The code accesses these portions and updates the first portion’s font to Arial. The modified workbook is saved as the output Excel file (5112366.xlsx).
C++ code to access and update rich text portions
Console output generated by the sample code
Here is the console output when using the source Excel file (5112369.xlsx):
Before updating the font settings....
Century
Courier New
Verdana
After updating the font settings....
Arial
Courier New
Verdana