{"id":8728,"date":"2019-07-30T15:59:42","date_gmt":"2019-07-30T19:59:42","guid":{"rendered":"http:\/\/nycphantom.com\/journal\/?p=8728"},"modified":"2019-08-02T15:48:04","modified_gmt":"2019-08-02T19:48:04","slug":"microsoft-word-javascript-add-in-api","status":"publish","type":"post","link":"http:\/\/nycphantom.com\/journal\/?p=8728","title":{"rendered":"Microsoft Word Javascript Add-in API"},"content":{"rendered":"\n<p>Learning this in order to replace the old 32 bit VBA macro template add-in for my company's letterheard wizard.<\/p>\n\n\n\n<p>Now I learn that the JS API doesn't import contents from a local file, but it could read from OoXML, which is what MS Office uses now (ie. dotx, docx, etc.) in the form of a zip (you can basically rename the file extension from docx to zip and you can find a packaged XML files. This is why the old Office 2003 doc, xls, etc. types are out of fashion today.<\/p>\n\n\n\n<p>In order to learn about OOXML handling with the JS API, refer to:  <a href=\"https:\/\/docs.microsoft.com\/en-us\/office\/dev\/add-ins\/word\/create-better-add-ins-for-word-with-office-open-xml \" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"https:\/\/docs.microsoft.com\/en-us\/office\/dev\/add-ins\/word\/create-better-add-ins-for-word-with-office-open-xml  (opens in a new tab)\">https:\/\/docs.microsoft.com\/en-us\/office\/dev\/add-ins\/word\/create-better-add-ins-for-word-with-office-open-xml <\/a><\/p>\n\n\n\n<p>Then it's good to <a rel=\"noreferrer noopener\" aria-label=\"know  (opens in a new tab)\" href=\"https:\/\/www.psclistens.com\/insight\/blog\/inserting-a-base64-encoded-image-into-a-word-2016-document\/\" target=\"_blank\">know <\/a>about the insertInlinePictureFromBase64 method. One can easily convert an image file to base64 <a rel=\"noreferrer noopener\" aria-label=\"online (opens in a new tab)\" href=\"https:\/\/www.base64-image.de\/\" target=\"_blank\">online<\/a>, and paste that base64 code into the parameter.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learning this in order to replace the old 32 bit VBA macro template add-in for my company's letterheard wizard. Now I learn that the JS API doesn't import contents from a local file, but it could read from OoXML, which &hellip; <a href=\"http:\/\/nycphantom.com\/journal\/?p=8728\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-8728","post","type-post","status-publish","format-standard","hentry","category-technical"],"_links":{"self":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/8728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8728"}],"version-history":[{"count":5,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/8728\/revisions"}],"predecessor-version":[{"id":8740,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=\/wp\/v2\/posts\/8728\/revisions\/8740"}],"wp:attachment":[{"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8728"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nycphantom.com\/journal\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}