Freigeben über


OpenXmlPartContainer.AddPart<T>-Methode (T)

Adds the part to the document. Must use the returned part to opertate the part added to the doucment

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

Syntax

'Declaration
Public Overridable Function AddPart(Of T As OpenXmlPart) ( _
    part As T _
) As T
'Usage
Dim instance As OpenXmlPartContainer
Dim part As T
Dim returnValue As T

returnValue = instance.AddPart(part)
public virtual T AddPart<T>(
    T part
)
where T : OpenXmlPart

Typparameter

  • T
    Derived class from OpenXmlPart.

Parameter

  • part
    Typ: T
    The part to be added to the document.

Rückgabewert

Typ: T
The added part in the doucment. Different from the passed in part.

Ausnahmen

Ausnahme Bedingung
ArgumentNullException

Thrown when "part" is null reference.

ArgumentOutOfRangeException

Thrown when the part is no allowed to be added.

OpenXmlPackageException

Thrown when one instance of same type part already exists and multiple instance of that type is not allowed.

Siehe auch

Referenz

OpenXmlPartContainer Klasse

OpenXmlPartContainer-Member

AddPart Überladung

DocumentFormat.OpenXml.Packaging-Namespace