OpenXmlPackage.getParts()

Return to the
Open XML SDK for JavaScript
Developer Center
Gets an array that contains all parts of the opened OpenXmlPackage object.

Syntax

    var partsList = OpenXmlPackage.getParts()

Return Value

    Returns an array of OpenXmlPart objects that contains all parts of the document.

Usage

    var partsList = OpenXmlPackage.getParts();

Example

// Open a blank document that is stored as a base64 string.
var doc = new openXml.OpenXmlPackage(blankDocument_base64);
// Get a list of all parts in the document and list them in the output text area.
var parts = doc.getParts();
var o = [];
for (var i = 0; i < parts.length; i++) {
    var part = parts[i];
    o.push("uri: " + part.uri);
    o.push("content type: " + part.contentType);
    o.push("");
}
return { output: o };