Skip to content

Instantly share code, notes, and snippets.

@AbidRahman-MSFT
AbidRahman-MSFT / Get bibliography CXP.WORD.yaml
Created March 6, 2021 01:50
Fetch the xml representation of the bibliography.
name: Get bibliography CXP
description: Fetch the xml representation of the bibliography.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Word.run(async (context) => {
@AbidRahman-MSFT
AbidRahman-MSFT / Content control basics.WORD.yaml
Created March 1, 2021 23:36
Inserts, updates, and retrieves content controls with HTML.
name: Content control basics
description: 'Inserts, updates, and retrieves content controls.'
host: WORD
api_set: {}
script:
content: |
$("#insert-controls").click(() => tryCatch(insertContentControls));
$("#change-controls").click(() => tryCatch(modifyContentControls));
$("#setup").click(() => tryCatch(setup));
@AbidRahman-MSFT
AbidRahman-MSFT / Ooxml footnotes.WORD.yaml
Last active November 18, 2021 14:36
Replace selection with sample text and footnote using Ooxml.
name: Ooxml footnotes
description: Replace selection with sample text and footnote using Ooxml.
host: WORD
api_set: {}
script:
content: >
$("#run").click(() => tryCatch(run));
const prefix = `<?xml version="1.0" encoding="UTF-8"?><pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage"><pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512"><pkg:xmlData><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml" /></Relationships></pkg:xmlData></pkg:part><pkg:part pkg:name="/word/_rels/document.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256"><pkg:xmlData><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId4" Type="http://schemas.openxmlform