Method InsertMathStructure
InsertMathStructure(WordDocument, MathPosition, MathElement, int)
Puts a structure into a slot: a copy of structure, whose base (a fraction's numerator, a
script's or radical's or n-ary operator's base, a function's argument, a matrix's first cell) takes the
selectedLength offsets after at, as Word puts a selection into a structure.
public static EquationEdit InsertMathStructure(this WordDocument document, MathPosition at, MathElement structure, int selectedLength = 0)
Parameters
documentWordDocumentThe document that holds the equation.
atMathPositionWhere the structure goes.
structureMathElementThe structure, used as a template (it is copied); not a run (type text instead).
selectedLengthintHow many offsets after
atgo into the structure; clamped to the slot's end.
Returns
- EquationEdit
The edit; After is the start of the structure's first empty shown slot, else the end of its base.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The equation is not in
document, or the structure is a run, has no slot, or is nested too deep.- InvalidOperationException
The position no longer names a slot of the equation.