OpenXmlCompositeElement.AddChild(OpenXmlElement, Boolean) 方法

定义

如果指定元素是已知的子元素,则将其添加到 元素。 这会根据架构将 元素添加到正确的位置。

public bool AddChild (DocumentFormat.OpenXml.OpenXmlElement newChild, bool throwOnError = true);
member this.AddChild : DocumentFormat.OpenXml.OpenXmlElement * bool -> bool
Public Function AddChild (newChild As OpenXmlElement, Optional throwOnError As Boolean = true) As Boolean

参数

newChild
OpenXmlElement

要追加的 OpenXmlElement 元素。

throwOnError
Boolean

一个标志,指示在无法添加子级时方法是否应引发。

返回

如果添加了元素,则成功,否则为 false

适用于