OpenXmlElement.ReplaceChild<T>(OpenXmlElement, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Replaces a child element with another child element in the current element's list of child elements.
public virtual T ReplaceChild<T> (DocumentFormat.OpenXml.OpenXmlElement newChild, T oldChild) where T : DocumentFormat.OpenXml.OpenXmlElement;
public virtual T ReplaceChild<T> (DocumentFormat.OpenXml.OpenXmlElement newChild, T? oldChild) where T : DocumentFormat.OpenXml.OpenXmlElement;
public virtual T? ReplaceChild<T> (DocumentFormat.OpenXml.OpenXmlElement newChild, T? oldChild) where T : DocumentFormat.OpenXml.OpenXmlElement;
abstract member ReplaceChild : DocumentFormat.OpenXml.OpenXmlElement * 'T -> 'T (requires 'T :> DocumentFormat.OpenXml.OpenXmlElement)
override this.ReplaceChild : DocumentFormat.OpenXml.OpenXmlElement * 'T -> 'T (requires 'T :> DocumentFormat.OpenXml.OpenXmlElement)
Public Overridable Function ReplaceChild(Of T As OpenXmlElement) (newChild As OpenXmlElement, oldChild As T) As T
Type Parameters
- T
Parameters
- newChild
- OpenXmlElement
The new child element to put in the list.
- oldChild
- T
The child element to replace in the list.
Returns
T
The OpenXmlElement element that was replaced.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for