Skip to content

Instantly share code, notes, and snippets.

View richie5um's full-sized avatar

Rich Somerfield richie5um

View GitHub Profile
name: References
description: ''
host: WORD
api_set: {}
script:
content: |
$("#check-fields").on("click", () => tryCatch(checkFields));
$("#get-fields").on("click", () => tryCatch(getFields));
$("#get-bookmarks").on("click", () => tryCatch(getBookmarks));
name: Smz-CustomXml-v4
description: ''
host: WORD
api_set: {}
script:
content: |
OfficeExtension.config.extendedErrorLogging = true;
$("#get-xml").click(() =>
tryCatch(() => {
name: Smz-GetDocx-CreateDocx
description: ''
host: WORD
api_set: {}
script:
content: >
$("#run").click(() => tryCatch(getDocumentAsCompressed));
// async function run() {
name: Smz-BasicComment (doesn't include selection)
description: ''
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Word.run(async (context) => {
@richie5um
richie5um / Smz-CommentRemoval.WORD.yaml
Created August 22, 2022 09:15
Create a new snippet from a blank template.
name: Smz-CommentRemoval
description: Create a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function removeCommentsFromXML(xmlString) {
let xmlText = "";
name: Smz-CustomXml-v3
description: ''
host: WORD
api_set: {}
script:
content: |
$("#get-xml").click(() =>
tryCatch(() => {
getCustomJson();
})
name: Comments (Ooxml)
description: ''
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(insertComment));
$("#get").click(() => tryCatch(getOoxml));
$("#set").click(() => tryCatch(setOoxml));
name: Comments (Ooxml)
description: ''
host: WORD
api_set: {}
script:
content: >
$("#run").click(() => tryCatch(insertComment2));
// async function insertComment3() {
name: Smz-CustomXml-v3
description: ''
host: WORD
api_set: {}
script:
content: |
$("#get-xml").click(() =>
tryCatch(() => {
getCustomJson();
})
name: Smz-CustomXml-v2
description: ''
host: WORD
api_set: {}
script:
content: |
$("#get-xml").click(() =>
tryCatch(() => {
getCustomJson();
})