OpenXmlCompositeElement.AddChild(OpenXmlElement, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
如果指定元素是已知的子元素,则将其添加到 元素。 这会根据架构将 元素添加到正确的位置。
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
。