Click or drag to resize

OpenXmlCompositeElementAddChild Method

Adds the specified element to the element if it is a known child. This adds the element in the correct location according to the schema.

Namespace: DocumentFormat.OpenXml
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll) Version: 2.20.0+Branch.release-v2.20.0.Sha.a873d3fbff9bffe179fea62486da950adf5be65d.a873d3fbff9bffe179fea62486da950adf5be65d
Syntax
public bool AddChild(
	OpenXmlElement newChild,
	bool throwOnError = true
)

Parameters

newChild  OpenXmlElement
The OpenXmlElement element to append.
throwOnError  Boolean  (Optional)
A flag to indicate if the method should throw if the child could not be added.

Return Value

Boolean
Success if the element was added, otherwise false.
See Also