I am using FlexCel under BCB6 updating a legacy application. I use the component extensively to parse content from .xls files created by our manufacturing software, so I am familiar with basic usage and operation.
Recently, I attempted to make use of the RTFRunList to determine if a cell contains text formatted using strikeout font, using the method below.
//---------------------------------------------------------------------------
// Excluded() -- Return true if cell contains strikeout text
//---------------------------------------------------------------------------
bool Excluded(TFlexCelImport *xl, int row, int col)
{
WideString s1 = xl->CellValue[row][col];
TFlxFont F;
TRTFRunList list;
list = xl->RTFRuns[row][col];
int len = list.Length;
for (int i = 0; i < len; ++i)
{
xl->GetFontList(list.FontIndex, F);
if (F.Style.Contains(flsStrikeOut))
return true;
}
return false;
}
For some reason, even when processing cells within a worksheet which are known to contain strikeout and other formatting (such as colorized text), RTFRuns[row][col]; always returns an empty list. I have stepped through the code above and inspected s1, to insure that it matches the (text) value of the relevant cell and inspection of that cell in Excel verifies that the cell contents are formatted.
Any ideas?