Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a pretty quick way to extract the formatting of text in a single
cell? For example, the cell may contain some text that is bold, superscript, underline, or italic. I want to convert the text to HTML, so that I can display it somewhere else. So far, I have the following code: int CharCount = Convert.ToString(Cell.Text).Length; int UnderlineStyle = (int)Microsoft.Office.Interop.Excel.XlUnderlineSty le.xlUnderlineStyleSingle; for (int CharNum = 0; CharNum < CharCount; CharNum++) { Microsoft.Office.Interop.Excel.Characters Char = Cell.get_Characters(CharNum + 1, 1); bool IsCharBold = (bool)Char.Font.Bold; bool IsCharUnderline = (int)Char.Font.Underline == UnderlineStyle; bool IsCharItalic = (bool)Char.Font.Italic; bool IsCharSuperScript = (bool)Char.Font.Superscript; /** some other code here **// } } However, the above code is extremely slow. I have some cells that contain over 1000 characters, and it takes several minutes to execute the code for the single cell. Does anyone know if there is a faster way to extract the formatting info? Thx, Filip Stanek |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extracting text from a cell | Excel Worksheet Functions | |||
Extracting text from a cell | Excel Worksheet Functions | |||
Fast Formatting | Excel Discussion (Misc queries) | |||
Extracting text from a cell | Excel Discussion (Misc queries) | |||
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' | Excel Programming |