 | 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.OpenXmlAssembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll) Version: 2.20.0+Branch.release-v2.20.0.Sha.a873d3fbff9bffe179fea62486da950adf5be65d.a873d3fbff9bffe179fea62486da950adf5be65d
Syntaxpublic bool AddChild(
OpenXmlElement newChild,
bool throwOnError = true
)
Public Function AddChild (
newChild As OpenXmlElement,
Optional throwOnError As Boolean = true
) As Boolean
public:
bool AddChild(
OpenXmlElement^ newChild,
bool throwOnError = true
)
member AddChild :
newChild : OpenXmlElement *
?throwOnError : bool
(* Defaults:
let _throwOnError = defaultArg throwOnError true
*)
-> bool
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
BooleanSuccess if the element was added, otherwise
false.
See Also