This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CCRangeTrack | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: > | |
var ccRange; | |
var insertRange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Blank snippet | |
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) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: InsertTableToContentControl (1) | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: > | |
$("#run").click(() => tryCatch(run)); | |
const wordWithTable = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SettingTest | |
description: >- | |
This sample shows how to get and set the change tracking mode and get the | |
before and after of reviewed text. | |
host: WORD | |
api_set: {} | |
script: | |
content: "$(\"#run\").click(() => tryCatch(run));\n\nasync function run() {\n await Word.run(async (context) => {\n //\_Queue\_commands\_add\_a\_setting.\n var settings = context.document.settings;\n var startMonth = settings.add(\"startMonth\", { month: \"March\", year: 1998 });\n var address = settings.add(\"country\", \"china\");\n\n //\_Queue\_a\_command\_to\_get\_the\_count\_of\_settings.\n var count = settings.getCount();\n\n //\_Synchronize\_the\_document\_state\_by\_executing\_the\_queued\_commands,\n //\_and\_return\_a\_promise\_to\_indicate\_task\_completion.\n await context.sync();\n console.log(\"current count: \" + count.value);\n\n //\_Queue\_a\_command\_to\_delete\_the\_setting.\n startMonth.delete();\n\n //\_Queue\_a\_command\_to\_get\_the\_new\_count\_of\_settings.\n count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FootEndNote | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
OfficeExtension.config.extendedErrorLogging = true; | |
$("#run").click(() => tryCatch(run)); | |
async function run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FootEndNote (1) | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
OfficeExtension.config.extendedErrorLogging = true; | |
$("#run").click(() => tryCatch(run)); | |
$("#getFirst").click(() => tryCatch(getFirst)); | |
$("#items").click(() => tryCatch(items)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FootEndNote (1) | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
OfficeExtension.config.extendedErrorLogging = true; | |
$("#run").click(() => tryCatch(run)); | |
$("#getFirst").click(() => tryCatch(getFirst)); | |
$("#items").click(() => tryCatch(items)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Blank snippet | |
description: Create a new snippet from a blank template. | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
Excel.run(async (context) => { | |
const range = context.workbook.getSelectedRange(); | |
range.format.fill.color = "red"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ContentControl&Save Demo | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: > | |
$("#file").change(getBase64); | |
$("#insert-doc").click(() => tryCatch(insertDoc)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OfficeAtWorkDemo | |
description: Create a new snippet from a blank template. | |
host: WORD | |
api_set: {} | |
script: | |
content: |- | |
OfficeExtension.config.extendedErrorLogging = true; | |
$("#file").change(getBase64); | |
$("#ok").click(() => tryCatch(run)); |
OlderNewer