OpenXmlPackage.getRelationshipById(relationshipId)
Return to the
Open XML SDK for JavaScript
Developer CenterGets the relationship with the specified relationship id.
Syntax
var rel = OpenXmlPackage.getRelationshipById(relationshipId);
Arguments
relationshipId: An string that contains the relationship id.
Return Value
Returns an OpenXmlRelationship object. If there are no relationships with the specified relationship id, this function returns null.
Usage
var part = pkg.getRelationshipById("rId1");
Example
// Open a blank document that is stored as a base64 string.
var doc = new openXml.OpenXmlPackage(blankDocument_base64);
var rel = doc.getRelationshipById("rId1");
var o = "";
if (rel !== null) {
o = "Relationship type of relationship: " + rel.relationshipType;
}
return { output: o };