Skip to content

Instantly share code, notes, and snippets.

View jipyua's full-sized avatar

MSFT-jipyua jipyua

View GitHub Profile
@jipyua
jipyua / Insert external worksheets (11).EXCEL.yaml
Created February 5, 2024 06:22
Inserts worksheets from another workbook into the current workbook.
name: Insert external worksheets (11)
description: Inserts worksheets from another workbook into the current workbook.
host: EXCEL
api_set: {}
script:
content: |
$("#file").change(getBase64);
$("#insert-sheets").click(() => tryCatch(insertSheets));
let externalWorkbook;
@jipyua
jipyua / citation item.WORD.yaml
Created January 30, 2024 12:43
Performs a basic Word API call using TypeScript.
name: citation item
description: Performs a basic Word API call using TypeScript.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
// Gets the current selection and changes the font color to red.
@jipyua
jipyua / Preview API testing.WORD.yaml
Last active January 25, 2024 09:08
Formats text with pre-built styles.
name: Preview API testing
description: Formats text with pre-built styles.
host: WORD
api_set: {}
script:
content: >
$("#add-preset").click(() => tryCatch(run));
//$("#add-preset2").click(() => tryCatch(addPreStyledFormattedText2));
@jipyua
jipyua / Track Change.WORD.yaml
Created January 16, 2024 01:36
Performs a basic Word API call using TypeScript.
name: Track Change
description: Performs a basic Word API call using TypeScript.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
$("#run2").click(() => tryCatch(run2));
$("#run3").click(() => tryCatch(run3));
@jipyua
jipyua / Insert external worksheets (11).EXCEL.yaml
Created November 3, 2023 03:08
Inserts worksheets from another workbook into the current workbook.
name: Insert external worksheets (11)
description: Inserts worksheets from another workbook into the current workbook.
host: EXCEL
api_set: {}
script:
content: |
$("#file").change(getBase64);
$("#insert-sheets").click(() => tryCatch(insertSheets));
let externalWorkbook;
@jipyua
jipyua / ShadingTestGetSet- BugBash .WORD.yaml
Created August 29, 2023 10:07
This sample shows how to perform operations on the styles in the current document and how to add and delete custom styles.
name: 'ShadingTestGetSet- BugBash '
description: >-
This sample shows how to perform operations on the styles in the current
document and how to add and delete custom styles.
host: WORD
api_set: {}
script:
content: >
$("#shading").click(() => tryCatch(getShadingProperties));
@jipyua
jipyua / Addin Field.WORD.yaml
Created April 20, 2023 08:21
Create a new snippet from a blank template.
name: Addin Field
description: Create a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
$("#run2").click(() => tryCatch(runHyperlink));
async function run() {
@jipyua
jipyua / InsertFileFromBase64 (1).WORD.yaml
Created April 11, 2023 07:27
Performs a basic Word API call using TypeScript.
name: InsertFileFromBase64 (1)
description: Performs a basic Word API call using TypeScript.
host: WORD
api_set: {}
script:
content: |
$("#file").change(getBase64);
$("#insert-sheets").click(() => tryCatch(insertDocument));
var externalDoc;
@jipyua
jipyua / InsertFileFromBase64.WORD.yaml
Created April 3, 2023 05:48
Performs a basic Word API call using TypeScript.
name: InsertFileFromBase64
description: Performs a basic Word API call using TypeScript.
host: WORD
api_set: {}
script:
content: |
$("#file").change(getBase64);
$("#insert-sheets").click(() => tryCatch(insertDocument));
let externalDoc;
@jipyua
jipyua / html with image.WORD.yaml
Created March 28, 2023 08:15
Inserts, updates, and retrieves content controls.
name: html with image
description: 'Inserts, updates, and retrieves content controls.'
host: WORD
api_set: {}
script:
content: |
$("#insert").click(() => tryCatch(insertPreHtml));
async function insertPreHtml() {
await Word.run(async (context) => {