功能變數
- Code: Select all
https://ppt.cc/foLBnx
MathType
- Code: Select all
https://ppt.cc/fm2pzx
https://ppt.cc/foLBnxhttps://ppt.cc/fm2pzx foreach (DocumentObject obj in cell.ChildObjects)
{
Paragraph para = obj as Paragraph;
if (para != null)
{
foreach (DocumentObject o in para.ChildObjects)
{
var type = o.GetType();
if (type == typeof(Field))
{
var item = o as Field;
if (item.Code.Contains("EQ"))
return true;
}
}
}
}
}//創建 Document 類的對象
Document document = new Document();
//從磁盤加載 Word 文檔
document.LoadFromFile(@"../../data/email.docx");
Paragraph paragraph = document.Sections[0].Paragraphs[0];
for (int i = 0; i < paragraph.ChildObjects.Count; i++)
{
DocumentObject documentObject= paragraph.ChildObjects[i];
if (documentObject is Field && ((Field)documentObject).Type == FieldType.FieldEquation)
{
//將eq轉為officeMath
OfficeMath officeMath = OfficeMath.FromEqField((Field)documentObject);
}
}