OpenXmlCompositeElement.ReplaceChild<T> Method (OpenXmlElement, T)

Replaces the child OpenXmlElement oldChild with newChild OpenXmlElement.

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


Public Overrides Function ReplaceChild(Of T As OpenXmlElement) ( _
    newChild As OpenXmlElement, _
    oldChild As T _
) As T
Dim instance As OpenXmlCompositeElement
Dim newChild As OpenXmlElement
Dim oldChild As T
Dim returnValue As T

returnValue = instance.ReplaceChild(newChild, _
public override T ReplaceChild<T>(
    OpenXmlElement newChild,
    T oldChild
where T : OpenXmlElement

Type Parameters

  • T


  • oldChild
    Type: T
    The OpenXmlElement being replaced in the list.

Return Value

Type: T
The OpenXmlElement replaced.


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

See Also


OpenXmlCompositeElement Class

OpenXmlCompositeElement Members

ReplaceChild Overload

DocumentFormat.OpenXml Namespace