AsOfficeMath

FieldEQ.AsOfficeMath method

返回与 EQ 字段对应的 Office Math 对象。

public OfficeMath AsOfficeMath()

返回值

返回无效的如果字段代码为空或无效,否则OfficeMath实例.

例子

展示如何用 Office Math 替换 EQ 字段。

Document doc = new Document(MyDir + "Field sample - EQ.docx");
FieldEQ fieldEQ = doc.Range.Fields.OfType<FieldEQ>().First();

OfficeMath officeMath = fieldEQ.AsOfficeMath();

fieldEQ.Start.ParentNode.InsertBefore(officeMath, fieldEQ.Start);
fieldEQ.Remove();

doc.Save(ArtifactsDir + "Field.EQAsOfficeMath.docx");

也可以看看