Hi,
I have a custom EA script that exports class details in Excel. I'm looking for a way to preserve the formatting (bold, italics, colours...) in the Excel cell.
I tried the various combinations of GetFieldFromFormat + GetFormatFromField methods on a sample text:
cellValue without any update
'text in <b>bold</b>
text in <i>italics</i> <u>underlined </u>text
<font color="#ff0000">red text, </font><font color="#0000ff">blue</font>, <font color="#ffff00">yellow</font>'
Repository.GetFieldFromFormat("HTML", cellValue)
'text in <b>bold</b> text in <i>italics</i> <u>underlined </u>text <font color="#ff0000">red text, </font><font color="#0000ff">blue</font>, <font color="#ffff00">yellow</font>'
Repository.GetFieldFromFormat("TXT", cellValue)
'text in <b>bold</b>
text in <i>italics</i> <u>underlined </u>text
<font color="#ff0000">red text, </font><font color="#0000ff">blue</font>, <font color="#ffff00">yellow</font>'
Repository.GetFormatFromField("HTML ", cellValue)
'text in <b>bold</b> text in <i>italics</i> <u>underlined </u>text <font color="#ff0000">red text, </font><font color="#0000ff">blue</font>, <font color="#ffff00">yellow</font>'
Repository.GetFormatFromField("TXT ", cellValue)
'text in bold
text in italics underlined text
red text, blue, yellow'
I currently use the latest option to remove all formatting. In Geert's VBImporter, the update is done using VBA Excel functions. I wonder if there's a way to transform via an EA script the cellValue so each specific text has the appropriate format applied i.e. to get the following in the Excel cell:
text in bold
text in italics underlined text
red text, blue, yellow