Table of Contents

Method InsertMathStructure

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

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

document WordDocument

The document that holds the equation.

at MathPosition

Where the structure goes.

structure MathElement

The structure, used as a template (it is copied); not a run (type text instead).

selectedLength int

How many offsets after at go 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.