Compartir a través de


OpenXmlPartContainer.AddNewPart<T> Method (String)

Adds a new part of type T

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

Syntax

'Declaration
Public Function AddNewPart(Of T As {OpenXmlPart, IFixedContentTypePart}) ( _
    id As String _
) As T
'Usage
Dim instance As OpenXmlPartContainer
Dim id As String
Dim returnValue As T

returnValue = instance.AddNewPart(id)
public T AddNewPart<T>(
    string id
)
where T : OpenXmlPart, IFixedContentTypePart

Type Parameters

  • T
    The class of the part.

Parameters

Return Value

Type: T
The added part.

Exceptions

Exception Condition
OpenXmlPackageException

When the part is not allowed to be referenced by this part.

See Also

Reference

OpenXmlPartContainer Class

OpenXmlPartContainer Members

AddNewPart Overload

DocumentFormat.OpenXml.Packaging Namespace