OpenXmlPackage.getPartById(relationshipId)
Return to the
Open XML SDK for JavaScript
Developer CenterGets the part that is the target of the relationship with the specified relationship id.
Syntax
var part = OpenXmlPackage.getPartById(relationshipId);
Arguments
relationshipId: An string that contains the relationship id.
Return Value
Returns an OpenXmlPart object. If there is no part related with the specified relationship id, this function returns null.
Usage
var part = doc.getPartByRelationshipId("rId1");
Example
// Open a blank document that is stored as a base64 string. var doc = new openXml.OpenXmlPackage(blankDocument_base64); // Get the main document part. var part = doc.getPartById("rId1"); if (part !== null) { o = "Found the part, uri = " + part.uri; } return { output: o };