OpenXmlPackage.getPartByUri(uri)

Return to the
Open XML SDK for JavaScript
Developer Center
Gets the part with the specified uri.

Syntax

    var part = OpenXmlPackage.getPartByUri(uri);

Arguments

    uri: An string that contains the uri.

Return Value

    Returns an OpenXmlPart object. If there is no part related with the specified relationship uri, this function returns null.

Usage

    var part = doc.getPartByUri("\word\document.xml");

Example

// Open a blank document that is stored as a base64 string.
var doc = new openXml.OpenXmlPackage(blankDocument_base64);
// Get the part with the uri of /word/document.xml
var part = doc.getPartByUri("/word/document.xml");
o = ["Content type of the main document part:", part.contentType];
return { output: o };