Skip to content

Instantly share code, notes, and snippets.

View leoseccia's full-sized avatar
🚀
Still here...

Leonardo Seccia leoseccia

🚀
Still here...
View GitHub Profile
@leoseccia
leoseccia / insert content controls.WORD.yaml
Created October 9, 2020 10:44
Create a new snippet from a blank template.
name: insert content controls
description: Create a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: |
$("#run").click(run);
async function run() {
await Word.run(async (context) => {
@leoseccia
leoseccia / Search.WORD.yaml
Created October 5, 2020 14:03
Shows basic and advanced search capabilities.
name: Search
description: Shows basic and advanced search capabilities.
host: WORD
api_set: {}
script:
content: |
const createOoxmlComment = (id, comment) => {
const ooxmlComment = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?mso-application progid="Word.Document"?>
<pkg:package
@leoseccia
leoseccia / get ooxml.WORD.yaml
Created June 19, 2020 09:55
Performs a basic Word API call using TypeScript.
name: get ooxml
description: Performs a basic Word API call using TypeScript.
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
/** Default helper for invoking an action and handling errors. */
async function tryCatch(callback) {
@leoseccia
leoseccia / migrate_repo.sh
Created February 24, 2020 12:53 — forked from mariozig/migrate_repo.sh
Migrate repo from GitLab to GitHub
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror [email protected]:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
name: 'Searching for @ and #'
description: ''
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Word.run(async (context) => {
@leoseccia
leoseccia / change cc controls.WORD.yaml
Created February 6, 2020 12:17
Create a new snippet from a blank template.
name: change cc controls
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(function(context) {
name: ContentControls
description: ''
host: WORD
api_set: {}
script:
content: >
Word.run(async (context) => {
var doc = Office.context.document;
doc.addHandlerAsync(Office.EventType.DocumentSelectionChanged, selectionChange);
});
@leoseccia
leoseccia / Get bookmarks.yaml
Created June 14, 2018 14:40
Shared with Script Lab
name: Get bookmarks
description: ''
author: leoseccia
host: WORD
api_set: {}
script:
content: |-
$("#run").click(() => tryCatch(run));
async function run() {