Skip to content

Instantly share code, notes, and snippets.

View hjkim-MSFT's full-sized avatar

Hoe Jin Kim - MSFT hjkim-MSFT

  • Microsoft
View GitHub Profile
@hjkim-MSFT
hjkim-MSFT / Blank snippet.EXCEL.yaml
Created February 26, 2022 01:02
Create a new snippet from a blank template.
name: Blank snippet
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@hjkim-MSFT
hjkim-MSFT / Check CF support.EXCEL.yaml
Created November 30, 2021 06:53
Check the requirement set for Custom Functions
name: Check CF support
description: Check the requirement set for Custom Functions
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
var isCFSupported = Office.context.requirements.isSetSupported("CustomFunctions", "1.1");
@hjkim-MSFT
hjkim-MSFT / Get document text by paragraphs.WORD.yaml
Created November 3, 2020 01:16
Create a new snippet from a blank template.
name: Get document text by paragraphs
description: Create a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Word.run(async (context) => {
@hjkim-MSFT
hjkim-MSFT / InsertFileFrombase64 (1).WORD.yaml
Created July 20, 2020 06:19
It inserts content control with some text using InsertFileFrombase64
name: InsertFileFrombase64 (1)
description: It inserts content control with some text using InsertFileFrombase64
host: WORD
api_set: {}
script:
content: |
$("#LoadFile").click(LoadFile);
async function LoadFile() {
await Word.run(async (context) => {
const body = context.document.body;
name: 'Search with ?{255} chunk'
description: ''
host: WORD
api_set: {}
script:
content: >
$("#row1Button").click(() => tryCatch(row1ButtonRun));
$("#row2Button").click(() => tryCatch(row2ButtonRun));
name: 'Search with ?{255} chunk'
description: ''
host: WORD
api_set: {}
script:
content: >
$("#row1Button").click(() => tryCatch(row1ButtonRun));
$("#row2Button").click(() => tryCatch(row2ButtonRun));
@hjkim-MSFT
hjkim-MSFT / Replace cc content with table issue - Workaround 2.WORD.yaml
Created June 17, 2020 21:42
Workaround 2 for the issue that Word inserts an undesirable paragraph when replacing a content control content with a table.
name: Replace cc content with table issue - Workaround 2
description: >-
Workaround 2 for the issue that Word inserts an undesirable paragraph when
replacing a content control content with a table.
host: WORD
api_set: {}
script:
content: >
$("#clear").click(() => tryCatch(clear));
@hjkim-MSFT
hjkim-MSFT / Replace cc content with table issue - Workaround.WORD.yaml
Created June 17, 2020 21:18
Workaround for the issue that Word inserts an undesirable paragraph when replacing a content control content with a table.
name: Replace cc content with table issue - Workaround
description: >-
Workaround for the issue that Word inserts an undesirable paragraph when
replacing a content control content with a table.
host: WORD
api_set: {}
script:
content: >
$("#clear").click(() => tryCatch(clear));
@hjkim-MSFT
hjkim-MSFT / Replace cc content with sectPr issue - workaround.WORD.yaml
Created June 17, 2020 20:50
A workaround for the issue that when importing content having sectPr in a cc already having a sectPr, the original sectPr does not get replaced
name: Replace cc content with sectPr issue - workaround
description: >-
A workaround for the issue that when importing content having sectPr in a cc
already having a sectPr, the original sectPr does not get replaced
host: WORD
api_set: {}
script:
content: >
$("#setup").click(() => tryCatch(setup));
@hjkim-MSFT
hjkim-MSFT / insertHtml issue.WORD.yaml
Created May 13, 2020 00:15
Create a new snippet from a blank template.
name: insertHtml issue
description: Create a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: >-
$("#run").click(() => tryCatch(run));
var myHtml = '<div style="padding-left:2em; text-indent:-2em;">Lorem ipsum