AsOfficeMath

FieldEQ.AsOfficeMath method

Returns Office Math object corresponded to the EQ field.

public OfficeMath AsOfficeMath()

Return Value

Returns null if field code is empty or invalid, otherwise an OfficeMath instance.

Examples

Shows how to replace the EQ field with Office Math.

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");

See Also