Returns the URI of this part within the package (e.g., "/word/document.xml").
Returns the OpenXmlPackage that contains this part.
Returns the MIME content type of this part (e.g., "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml").
Returns the raw data of this part. For XML parts, prefer getXDocument.
Sets the MIME content type of this part.
Sets the raw data of this part. For XML parts, prefer putXDocument.
Returns the URI of the .rels file associated with this part.
Returns the .rels part associated with this part, or undefined if none exists.
Returns all relationships defined for this part.
An array of OpenXmlRelationship objects.
Returns all internal parts referenced by this part's relationships.
An array of OpenXmlPart instances.
Returns relationships of this part filtered by relationship type.
The relationship type URI. Use RelationshipType constants.
Returns parts targeted by relationships of the given type.
The relationship type URI. Use RelationshipType constants.
Returns the first part targeted by a relationship of the given type.
The relationship type URI. Use RelationshipType constants.
The first matching OpenXmlPart, or undefined.
Adds a relationship to this part.
The relationship ID (e.g., "rId10").
The relationship type URI. Use RelationshipType constants.
The target URI (relative to this part).
"Internal" (default) or "External".
The newly created OpenXmlRelationship.
Returns the XML content of this part as an XDocument.
A promise resolving to the part's XDocument.
The XDocument is parsed on first access and cached for subsequent calls. Modifications to the returned XDocument are reflected in the part. Call putXDocument to replace the XML content entirely.
Returns the custom XML properties part, or undefined if not present.
Returns the theme part, or undefined if not present.
Returns the thumbnail part, or undefined if not present.
Returns the drawings part, or undefined if not present.
Returns all image parts referenced by this part.
Returns all custom XML parts referenced by this part.
Finds a relationship of this part by its ID.
The relationship ID (e.g., "rId1").
Finds a part by following a relationship ID from this part.
The relationship ID (e.g., "rId1").
Returns relationships whose target parts have the given content type.
The MIME content type. Use ContentType constants.
Returns parts whose content type matches the given value.
The MIME content type. Use ContentType constants.
Represents a single part within an Open XML package.
Remarks
A part is one file inside the ZIP archive that makes up an Open XML document. Parts can contain XML (document content, styles, relationships) or binary data (images, embedded objects).
Use getXDocument() to read and putXDocument() to write XML content. Navigate to related parts via the relationship methods.
For format-specific convenience methods, see the subclasses WmlPart, SmlPart, and PmlPart.
Example