{"id":2154,"date":"2016-02-04T06:08:27","date_gmt":"2016-02-04T06:08:27","guid":{"rendered":"http:\/\/www.ericwhite.com\/home2\/bm8qcmjy\/public_html\/blog\/?page_id=2154"},"modified":"2016-02-04T06:08:51","modified_gmt":"2016-02-04T06:08:51","slug":"openxmlpart-getrelationshipbyid","status":"publish","type":"page","link":"https:\/\/www.ericwhite.com\/blog\/openxmlpart-getrelationshipbyid\/","title":{"rendered":"OpenXmlPart.getRelationshipById(relationshipId)"},"content":{"rendered":"<p><span class=\"Back\"><a class=\"Back\" href=\"https:\/\/www.ericwhite.com\/blog\/open-xml-sdk-for-javascript\/\">Return to the<br \/>Open XML SDK for JavaScript<br \/>Developer Center<\/a><\/span>Gets the relationship with the specified relationship id.<\/p>\n<h1>Syntax<\/h1>\n<pre>\r\n    var rel = OpenXmlPart.getRelationshipById(relationshipId);\r\n<\/pre>\n<h1>Arguments<\/h1>\n<pre>\r\n    relationshipId: An string that contains the relationship id.\r\n<\/pre>\n<h1>Return Value<\/h1>\n<pre>\r\n    Returns an OpenXmlRelationship object. If there are no relationships with the specified relationship id, this function returns null.\r\n<\/pre>\n<h1>Usage<\/h1>\n<pre>\r\n    var part = pkg.mainDocumentPart().getRelationshipById(\"rId1\");\r\n<\/pre>\n<h1>Example<\/h1>\n<pre>\r\n\/\/ Open a blank document that is stored as a base64 string.\r\nvar doc = new openXml.OpenXmlPackage(blankDocument_base64);\r\nvar rel = doc.mainDocumentPart().getRelationshipById(\"rId1\");\r\nvar o = \"\";\r\nif (rel !== null) {\r\n    o = \"Relationship type of relationship: \" + rel.relationshipType;\r\n}\r\nreturn { output: o };\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Return to theOpen XML SDK for JavaScriptDeveloper CenterGets the relationship with the specified relationship id. Syntax var rel = OpenXmlPart.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.mainDocumentPart().getRelationshipById(&#8220;rId1&#8221;); Example [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_s2mail":"","footnotes":""},"class_list":["post-2154","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/comments?post=2154"}],"version-history":[{"count":2,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2154\/revisions"}],"predecessor-version":[{"id":2156,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2154\/revisions\/2156"}],"wp:attachment":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/media?parent=2154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}