[英]Import Rich Text Data From Excel Sheet Using c#
I want to import data from excel sheet with richtext ie font family 我想从带有丰富文本即字体系列的Excel工作表中导入数据
But I can get only bold and italic style using below given code 但是我只能使用下面给出的代码获得粗体和斜体样式
Microsoft.Office.Interop.Excel.Range Range = (Microsoft.Office.Interop.Excel.Range)Cell;
int TextLength = Range.Text.ToString().Length;
for (int CharCount = 1; CharCount <= TextLength; CharCount++)
{
Microsoft.Office.Interop.Excel.Characters charToTest = Range.get_Characters(CharCount, 1);
bool IsBold = (bool)charToTest.Font.Bold;
bool IsItalic = (bool)charToTest.Font.Italic;
// other formatting tests here
}
Can anybody help me to get the rich text data from Excel Sheet using Interop or any other method in c#.net 谁能帮助我使用Interop或c#.net中的任何其他方法从Excel Sheet中获取富文本数据。
Thanks in advance 提前致谢
How about: 怎么样:
Range someRange = activeWorksheet.Range["A1", "A1"];
var fontFamily = someRange.Font.Name;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.