InsertBefore(T) method (T, OpenXmlElement)
Collapse the table of content
Expand the table of content

OpenXmlCompositeElement.InsertBefore<T> method (T, OpenXmlElement)

Office 2013 and later

Inserts the specified element immediately before the specified reference element.

Namespace:  DocumentFormat.OpenXml
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public override T InsertBefore<T>(
	T newChild,
	OpenXmlElement refChild
)
where T : OpenXmlElement

Type parameters

T

Parameters

newChild
Type: T

The OpenXmlElement to insert.

refChild
Type: DocumentFormat.OpenXml.OpenXmlElement

The OpenXmlElement that is the reference node. The newChild is placed before this OpenXmlElement.

Return value

Type: T
The OpenXmlElement that was inserted.

No change if the (newChild == null). Just return null.

Show:
© 2016 Microsoft