This sample shows how to use priorities to work with conditional formatting of ranges when more than one conditional format applies to some cells.
From 9e0642eb0c3d15f9d41bd70daf4f09636a6433c0 Mon Sep 17 00:00:00 2001
From: Sam Ramon <15154970+samantharamon@users.noreply.github.com>
Date: Fri, 21 Mar 2025 16:22:15 -0700
Subject: [PATCH 1/2] Run script to remove library dependencies
---
.../excel/01-basics/basic-api-call-es5.yaml | 24 +++--
samples/excel/01-basics/basic-api-call.yaml | 24 +++--
.../01-basics/basic-common-api-call.yaml | 26 +++--
.../excel/10-chart/chart-axis-formatting.yaml | 25 ++---
samples/excel/10-chart/chart-axis.yaml | 55 +++++++----
.../excel/10-chart/chart-bubble-chart.yaml | 29 +++---
.../10-chart/chart-create-several-charts.yaml | 52 ++++------
samples/excel/10-chart/chart-data-source.yaml | 27 +++---
samples/excel/10-chart/chart-data-table.yaml | 26 +++--
samples/excel/10-chart/chart-formatting.yaml | 43 +++++----
samples/excel/10-chart/chart-legend.yaml | 33 +++----
samples/excel/10-chart/chart-point.yaml | 30 ++----
.../excel/10-chart/chart-series-markers.yaml | 29 +++---
.../10-chart/chart-series-plotorder.yaml | 30 +++---
samples/excel/10-chart/chart-series.yaml | 36 +++----
.../excel/10-chart/chart-title-format.yaml | 31 +++---
samples/excel/10-chart/chart-trendlines.yaml | 51 ++++++----
.../excel/10-chart/create-doughnut-chart.yaml | 24 ++---
samples/excel/12-comment/comment-basics.yaml | 34 +++----
.../excel/12-comment/comment-mentions.yaml | 24 ++---
samples/excel/12-comment/comment-replies.yaml | 34 +++----
.../excel/12-comment/comment-resolution.yaml | 41 ++++----
.../conditional-formatting-advanced.yaml | 28 +++---
.../conditional-formatting-basic.yaml | 38 ++++----
.../16-custom-functions/basic-function.yaml | 2 +-
.../custom-functions-errors.yaml | 12 ++-
.../data-types-custom-functions.yaml | 18 +++-
.../streaming-function.yaml | 5 +-
.../web-call-function.yaml | 17 +++-
...e-set-get-and-delete-custom-xml-parts.yaml | 29 +++---
.../test-xml-for-unique-namespace.yaml | 25 ++---
.../data-types-entity-attribution.yaml | 31 +++---
.../data-types-entity-icons.yaml | 33 ++++---
.../data-types-entity-values.yaml | 50 ++++++----
.../data-types-error-values.yaml | 38 ++++----
.../data-types-formatted-number.yaml | 30 +++---
.../20-data-types/data-types-references.yaml | 33 ++++---
.../20-data-types/data-types-web-image.yaml | 50 ++++++----
.../22-data-validation/data-validation.yaml | 29 +++---
.../excel/26-document/custom-properties.yaml | 29 +++---
.../26-document/get-file-in-slices-async.yaml | 24 ++---
samples/excel/26-document/properties.yaml | 31 +++---
.../30-events/data-change-event-details.yaml | 33 ++++---
samples/excel/30-events/data-changed.yaml | 22 ++---
.../30-events/event-column-and-row-sort.yaml | 37 ++++----
.../event-worksheet-single-click.yaml | 21 ++--
.../30-events/events-chart-activated.yaml | 27 +++---
...vents-chartcollection-added-activated.yaml | 26 +++--
.../events-comment-event-handler.yaml | 35 ++++---
.../30-events/events-disable-events.yaml | 26 +++--
.../30-events/events-formula-changed.yaml | 25 ++---
.../excel/30-events/events-table-changed.yaml | 35 +++----
.../events-tablecollection-changed.yaml | 30 ++----
.../30-events/events-workbook-activated.yaml | 20 ++--
...nts-workbook-and-worksheet-collection.yaml | 40 ++++----
.../events-worksheet-protection.yaml | 36 +++----
samples/excel/30-events/events-worksheet.yaml | 38 ++++----
.../30-events/selection-changed-events.yaml | 29 +++---
.../create-and-remove-named-item.yaml | 64 +++++++++----
.../34-named-item/update-named-item.yaml | 33 ++++---
.../pivottable-calculations.yaml | 46 +++++----
.../pivottable-create-and-modify.yaml | 36 ++++---
.../pivottable-filters-and-summaries.yaml | 71 +++++++++-----
.../pivottable-get-pivottables.yaml | 29 +++---
.../pivottable-pivotfilters.yaml | 60 ++++++++----
.../38-pivottable/pivottable-pivotlayout.yaml | 41 ++++----
.../38-pivottable/pivottable-refresh.yaml | 37 ++++----
.../38-pivottable/pivottable-slicer.yaml | 62 ++++++++----
.../38-pivottable/pivottable-source-data.yaml | 24 ++---
samples/excel/42-range/cell-properties.yaml | 34 ++++---
samples/excel/42-range/dynamic-arrays.yaml | 31 +++---
samples/excel/42-range/formatting.yaml | 28 ++----
.../42-range/insert-delete-clear-range.yaml | 45 +++++----
samples/excel/42-range/outline.yaml | 55 +++++++----
samples/excel/42-range/precedents.yaml | 40 ++++----
samples/excel/42-range/range-areas.yaml | 34 +++----
samples/excel/42-range/range-auto-fill.yaml | 45 +++++----
samples/excel/42-range/range-copyfrom.yaml | 36 ++++---
samples/excel/42-range/range-dependents.yaml | 53 +++++++----
.../42-range/range-direct-dependents.yaml | 30 +++---
samples/excel/42-range/range-find.yaml | 28 +++---
.../excel/42-range/range-get-range-edge.yaml | 36 ++++---
samples/excel/42-range/range-hyperlink.yaml | 32 +++----
.../excel/42-range/range-merged-ranges.yaml | 34 ++++---
.../excel/42-range/range-relationships.yaml | 35 +++----
.../42-range/range-remove-duplicates.yaml | 36 +++----
.../42-range/range-text-orientation.yaml | 26 ++---
samples/excel/42-range/selected-range.yaml | 31 +++---
samples/excel/42-range/set-get-values.yaml | 71 +++++++++-----
samples/excel/42-range/style.yaml | 38 +++-----
samples/excel/42-range/used-range.yaml | 29 +++---
.../44-shape/shape-create-and-delete.yaml | 46 +++++----
samples/excel/44-shape/shape-groups.yaml | 46 +++++----
samples/excel/44-shape/shape-images.yaml | 39 +++++---
samples/excel/44-shape/shape-lines.yaml | 34 +++----
.../excel/44-shape/shape-move-and-order.yaml | 56 +++++++----
samples/excel/44-shape/shape-textboxes.yaml | 32 +++----
.../add-rows-and-columns-to-a-table.yaml | 28 +++---
.../46-table/convert-range-to-table.yaml | 26 ++---
samples/excel/46-table/create-table.yaml | 27 +++---
samples/excel/46-table/filter-data.yaml | 37 ++++----
samples/excel/46-table/formatting.yaml | 32 ++++---
.../excel/46-table/get-data-from-table.yaml | 34 +++----
...get-visible-range-of-a-filtered-table.yaml | 45 +++++----
samples/excel/46-table/import-json-data.yaml | 29 +++---
samples/excel/46-table/resize-table.yaml | 29 +++---
samples/excel/46-table/sort-data.yaml | 34 +++----
.../create-get-change-delete-settings.yaml | 39 ++++----
.../excel/50-workbook/create-workbook.yaml | 23 ++---
.../50-workbook/culture-info-date-time.yaml | 33 +++----
samples/excel/50-workbook/culture-info.yaml | 31 +++---
.../excel/50-workbook/data-protection.yaml | 36 +++----
.../workbook-built-in-functions.yaml | 36 +++----
.../50-workbook/workbook-calculation.yaml | 39 ++++----
.../50-workbook/workbook-get-active-cell.yaml | 24 +++--
.../workbook-insert-external-worksheets.yaml | 27 +++---
.../50-workbook/workbook-save-and-close.yaml | 39 ++++----
.../excel/54-worksheet/active-worksheet.yaml | 26 ++---
.../add-delete-rename-move-worksheet.yaml | 46 +++++----
samples/excel/54-worksheet/gridlines.yaml | 32 +++----
.../excel/54-worksheet/list-worksheets.yaml | 26 +++--
...rence-worksheets-by-relative-position.yaml | 26 ++---
samples/excel/54-worksheet/tab-color.yaml | 28 +++---
.../54-worksheet/worksheet-auto-filter.yaml | 34 +++----
.../excel/54-worksheet/worksheet-copy.yaml | 29 +++---
.../54-worksheet/worksheet-find-all.yaml | 39 +++++---
.../54-worksheet/worksheet-freeze-panes.yaml | 54 +++++++----
.../54-worksheet/worksheet-page-layout.yaml | 61 ++++++++----
.../54-worksheet/worksheet-range-cell.yaml | 49 ++++++----
.../54-worksheet/worksheet-visibility.yaml | 38 ++++----
.../90-scenarios/currency-converter.yaml | 57 +++++++----
.../90-scenarios/multiple-property-set.yaml | 24 ++---
.../performance-optimization.yaml | 38 ++++----
.../excel/90-scenarios/report-generation.yaml | 29 +++---
.../90-scenarios/working-with-dates.yaml | 32 +++----
.../excel/99-just-for-fun/color-wheel.yaml | 40 ++++----
samples/excel/99-just-for-fun/gradient.yaml | 46 +++++----
.../99-just-for-fun/path-finder-game.yaml | 48 ++++++----
samples/excel/99-just-for-fun/patterns.yaml | 44 +++++----
samples/excel/99-just-for-fun/tetrominos.yaml | 30 +++---
samples/excel/default.yaml | 24 +++--
samples/onenote/default.yaml | 24 +++--
.../10-roaming-settings/roaming-settings.yaml | 29 +++---
.../load-set-get-save.yaml | 46 +++++----
.../20-item-body/add-inline-base64-image.yaml | 30 +++---
.../20-item-body/append-text-on-send.yaml | 22 ++---
.../outlook/20-item-body/get-body-format.yaml | 22 ++---
.../20-item-body/get-selected-data.yaml | 22 ++---
.../20-item-body/prepend-text-on-send.yaml | 25 +++--
.../prepend-text-to-item-body.yaml | 22 ++---
.../20-item-body/replace-selected-text.yaml | 25 +++--
.../25-item-save-and-close/close-async.yaml | 22 ++---
.../outlook/25-item-save-and-close/close.yaml | 23 ++---
.../outlook/25-item-save-and-close/save.yaml | 23 ++---
.../get-all-attendees.yaml | 24 +++--
.../get-cc-message-read.yaml | 21 ++--
.../get-from-message-compose.yaml | 21 ++--
.../get-from-message-read.yaml | 21 ++--
...tional-attendees-appointment-attendee.yaml | 20 ++--
.../get-organizer-appointment-attendee.yaml | 22 ++---
.../get-organizer-appointment-organizer.yaml | 22 ++---
...quired-attendees-appointment-attendee.yaml | 20 ++--
.../get-sender-message-read.yaml | 22 ++---
.../get-set-bcc-message-compose.yaml | 25 +++--
.../get-set-cc-message-compose.yaml | 25 +++--
...ional-attendees-appointment-organizer.yaml | 22 ++---
...uired-attendees-appointment-organizer.yaml | 22 ++---
.../get-set-to-message-compose.yaml | 25 +++--
.../get-to-message-read.yaml | 21 ++--
.../35-notifications/add-getall-remove.yaml | 37 ++++----
.../40-attachments/attachments-compose.yaml | 40 ++++----
.../get-attachment-content.yaml | 22 ++---
.../40-attachments/get-attachments-read.yaml | 22 ++---
.../45-categories/work-with-categories.yaml | 34 +++----
.../work-with-master-categories.yaml | 26 ++---
.../50-recurrence/get-recurrence-read.yaml | 20 ++--
.../outlook/50-recurrence/get-series-id.yaml | 22 ++---
...-set-recurrence-appointment-organizer.yaml | 25 +++--
.../display-existing-appointment.yaml | 30 +++---
.../display-existing-message.yaml | 32 +++----
.../display-new-appointment.yaml | 29 +++---
.../55-display-items/display-new-message.yaml | 31 +++---
.../55-display-items/display-reply-forms.yaml | 28 +++---
.../display-reply-with-attachments.yaml | 36 +++----
.../sensitivity-label.yaml | 25 ++---
.../sensitivity-labels-catalog.yaml | 25 ++---
.../get-shared-properties.yaml | 25 ++---
.../get-internet-headers-message-read.yaml | 26 ++---
...stom-internet-headers-message-compose.yaml | 27 +++---
.../outlook/75-regex-matches/contextual.yaml | 28 +++---
.../get-icaluid-as-attendee.yaml | 27 +++---
.../get-icaluid-as-organizer.yaml | 25 +++--
.../ids-and-urls.yaml | 25 ++---
.../make-ews-request-async.yaml | 22 ++---
...-message-using-make-ews-request-async.yaml | 22 ++---
.../user-callback-token.yaml | 26 +++--
.../user-identity-token.yaml | 25 ++---
.../delay-message-delivery.yaml | 30 +++---
...d-remove-enhancedlocation-appointment.yaml | 32 +++----
.../get-conversation-id-message.yaml | 22 ++---
.../get-conversation-index.yaml | 23 ++---
.../get-date-time-created-read.yaml | 22 ++---
.../get-date-time-modified-read.yaml | 22 ++---
.../get-diagnostic-information.yaml | 22 ++---
.../90-other-item-apis/get-eml-format.yaml | 22 ++---
.../90-other-item-apis/get-end-read.yaml | 21 ++--
.../90-other-item-apis/get-in-reply-to.yaml | 22 ++---
.../get-internet-message-id-read.yaml | 22 ++---
.../get-item-class-async.yaml | 20 ++--
.../get-item-class-read.yaml | 21 ++--
.../90-other-item-apis/get-item-type.yaml | 19 ++--
.../get-loaded-message-properties.yaml | 36 ++++---
.../90-other-item-apis/get-location-read.yaml | 22 ++---
.../get-message-properties.yaml | 22 ++---
.../get-normalized-subject-read.yaml | 22 ++---
.../get-set-end-appointment-organizer.yaml | 26 +++--
...et-set-location-appointment-organizer.yaml | 26 +++--
.../get-set-sensitivity-level.yaml | 23 ++---
.../get-set-start-appointment-organizer.yaml | 26 +++--
.../get-set-subject-compose.yaml | 26 +++--
.../90-other-item-apis/get-start-read.yaml | 22 ++---
.../90-other-item-apis/get-subject-read.yaml | 21 ++--
.../90-other-item-apis/item-id-compose.yaml | 22 ++---
.../90-other-item-apis/send-async.yaml | 20 ++--
.../90-other-item-apis/session-data-apis.yaml | 45 +++++----
.../90-other-item-apis/set-selected-data.yaml | 22 ++---
.../work-with-client-signatures.yaml | 31 +++---
.../get-set-isalldayevent.yaml | 21 ++--
.../set-displayed-body-subject.yaml | 28 +++---
samples/outlook/default.yaml | 20 ++--
.../powerpoint/basics/basic-api-call-js.yaml | 25 +++--
.../powerpoint/basics/basic-api-call-ts.yaml | 28 +++---
.../basics/basic-common-api-call.yaml | 24 ++---
samples/powerpoint/default.yaml | 21 ++--
.../document/create-presentation.yaml | 23 ++---
.../hyperlinks/manage-hyperlinks.yaml | 26 +++--
samples/powerpoint/images/insert-image.yaml | 19 ++--
samples/powerpoint/images/insert-svg.yaml | 20 ++--
.../scenarios/searches-wikipedia-api.yaml | 52 ++++++----
samples/powerpoint/shapes/get-set-shapes.yaml | 95 +++++++++++++------
.../powerpoint/shapes/get-shapes-by-type.yaml | 27 ++----
samples/powerpoint/shapes/shapes.yaml | 44 +++------
.../slide-management/add-slides.yaml | 35 ++++---
.../slide-management/get-set-slides.yaml | 49 ++++++----
.../slide-management/get-slide-metadata.yaml | 26 +++--
.../slide-management/insert-slides.yaml | 22 ++---
samples/powerpoint/tags/tags.yaml | 39 +++-----
.../powerpoint/text/get-set-textrange.yaml | 33 +++----
.../project/basics/basic-common-api-call.yaml | 27 +++---
samples/project/default.yaml | 21 ++--
samples/web/default.yaml | 18 ++--
.../word/01-basics/basic-api-call-es5.yaml | 25 +++--
samples/word/01-basics/basic-api-call.yaml | 25 +++--
.../word/01-basics/basic-common-api-call.yaml | 25 +++--
.../content-control-onadded-event.yaml | 27 +++---
.../content-control-ondatachanged-event.yaml | 27 +++---
.../content-control-ondeleted-event.yaml | 29 +++---
.../content-control-onentered-event.yaml | 27 +++---
.../content-control-onexited-event.yaml | 27 +++---
...tent-control-onselectionchanged-event.yaml | 27 +++---
.../get-change-tracking-states.yaml | 28 +++---
...t-and-change-checkbox-content-control.yaml | 44 +++++----
...-and-change-combo-box-content-control.yaml | 54 +++++++----
.../insert-and-change-content-controls.yaml | 34 ++++---
...-change-dropdown-list-content-control.yaml | 54 +++++++----
.../15-images/insert-and-get-pictures.yaml | 35 ++++---
samples/word/20-lists/insert-list.yaml | 27 +++---
samples/word/20-lists/manage-list-styles.yaml | 26 ++---
samples/word/20-lists/organize-list.yaml | 32 ++++---
.../get-paragraph-on-insertion-point.yaml | 35 ++++---
samples/word/25-paragraph/get-text.yaml | 32 ++++---
samples/word/25-paragraph/get-word-count.yaml | 29 +++---
.../25-paragraph/insert-formatted-text.yaml | 32 ++++---
.../insert-header-and-footer.yaml | 30 +++---
.../insert-in-different-locations.yaml | 46 +++++----
.../insert-line-and-page-breaks.yaml | 31 +++---
samples/word/25-paragraph/onadded-event.yaml | 29 +++---
.../word/25-paragraph/onchanged-event.yaml | 29 +++---
.../word/25-paragraph/ondeleted-event.yaml | 27 +++---
.../25-paragraph/paragraph-properties.yaml | 34 +++----
samples/word/25-paragraph/search.yaml | 31 +++---
.../get-built-in-properties.yaml | 22 ++---
...read-write-custom-document-properties.yaml | 33 ++++---
samples/word/35-ranges/compare-location.yaml | 24 ++---
samples/word/35-ranges/scroll-to-range.yaml | 32 ++++---
.../split-words-of-first-paragraph.yaml | 34 +++----
.../word/40-tables/manage-custom-style.yaml | 47 ++++-----
samples/word/40-tables/manage-formatting.yaml | 40 ++++----
samples/word/40-tables/table-cell-access.yaml | 27 +++---
.../word/50-document/compare-documents.yaml | 24 +++--
.../word/50-document/get-external-styles.yaml | 23 +++--
.../50-document/insert-external-document.yaml | 26 +++--
.../50-document/insert-section-breaks.yaml | 26 ++---
.../word/50-document/manage-annotations.yaml | 37 ++++----
samples/word/50-document/manage-body.yaml | 46 ++++-----
.../50-document/manage-change-tracking.yaml | 29 +++---
samples/word/50-document/manage-comments.yaml | 41 ++++----
.../manage-custom-xml-part-ns.yaml | 37 ++++----
.../50-document/manage-custom-xml-part.yaml | 31 +++---
samples/word/50-document/manage-fields.yaml | 39 ++++----
.../word/50-document/manage-footnotes.yaml | 41 ++++----
samples/word/50-document/manage-settings.yaml | 37 ++++----
samples/word/50-document/manage-styles.yaml | 67 ++++++++-----
.../50-document/manage-tracked-changes.yaml | 38 ++++----
samples/word/50-document/save-close.yaml | 49 ++++++----
.../correlated-objects-pattern.yaml | 20 ++--
samples/word/90-scenarios/doc-assembly.yaml | 26 ++---
.../90-scenarios/multiple-property-set.yaml | 22 ++---
.../insert-and-change-content-controls.yaml | 42 ++++----
.../word/99-preview-apis/manage-comments.yaml | 43 ++++-----
samples/word/default.yaml | 24 +++--
311 files changed, 4762 insertions(+), 5019 deletions(-)
diff --git a/samples/excel/01-basics/basic-api-call-es5.yaml b/samples/excel/01-basics/basic-api-call-es5.yaml
index d5c3fc8e0..d69f3759c 100644
--- a/samples/excel/01-basics/basic-api-call-es5.yaml
+++ b/samples/excel/01-basics/basic-api-call-es5.yaml
@@ -7,8 +7,10 @@ host: EXCEL
api_set:
ExcelApi: '1.1'
script:
- content: |
- $("#run").on("click", () => tryCatch(run));
+ content: >-
+ document.getElementById("run").addEventListener("click", () =>
+ tryCatch(run));
+
function run() {
return Excel.run(function (context) {
@@ -22,7 +24,9 @@ script:
});
}
+
/** Default helper for invoking an action and handling errors. */
+
function tryCatch(callback) {
Promise.resolve()
.then(callback)
@@ -33,7 +37,7 @@ script:
}
language: typescript
template:
- content: |
+ content: >-
This sample demonstrates basic Excel API calls. This sample demonstrates basic Excel API calls. This sample uses the Common APIs compatible with Office 2013. This sample shows how to format the vertical and horizontal axis in a chart. This sample shows how to get, set, and remove axis unit, label and title in a chart. This sample shows how to create a bubble chart, with each chart series (or bubble) representing a single table row. This sample shows how to create column-clustered, line, XY-scatter, area, radar, pie, 3D, cylinder, and 100% charts.
This sample shows how to get information about the data source of a chart series.
This sample shows how to add a data table to a chart and then format that data table.
This sample shows how to format different aspects of a chart.
This sample shows how to turn events on and off.
The handlers update the "Grand Total" cell when events are fired (and enabled). Try editing the cells or refreshing the data with events enabled and disabled.
@@ -175,13 +177,7 @@ style: language: css libraries: |- https://appsforoffice.microsoft.com/lib/1/hosted/office.js - @types/office-js - - office-ui-fabric-core@11.1.0/dist/css/fabric.min.css - office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css - - core-js@2.4.1/client/core.min.js - @types/core-js + https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts - jquery@3.1.1 - @types/jquery@3.3.1 + https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css + https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css diff --git a/samples/excel/30-events/events-formula-changed.yaml b/samples/excel/30-events/events-formula-changed.yaml index 6c10c734b..c8174682a 100644 --- a/samples/excel/30-events/events-formula-changed.yaml +++ b/samples/excel/30-events/events-formula-changed.yaml @@ -6,10 +6,10 @@ host: EXCEL api_set: ExcelAPI: '1.13' script: - content: | - $("#setup").on("click", () => tryCatch(setup)); - $("#register-formula-change-handler").on("click", () => tryCatch(registerFormulaChangeHandler)); - $("#trigger-formula-change").on("click", () => tryCatch(triggerFormulaChange)); + content: |- + document.getElementById("setup").addEventListener("click", () => tryCatch(setup)); + document.getElementById("register-formula-change-handler").addEventListener("click", () => tryCatch(registerFormulaChangeHandler)); + document.getElementById("trigger-formula-change").addEventListener("click", () => tryCatch(triggerFormulaChange)); async function registerFormulaChangeHandler() { await Excel.run(async (context) => { @@ -84,10 +84,11 @@ script: } language: typescript template: - content: |- + content: >-This sample shows how to register a formula changed event handler and detect details about the changed formula.
Set up the worksheet.
@@ -117,15 +118,9 @@ style: min-width: 80px; } language: css -libraries: | +libraries: |- https://appsforoffice.microsoft.com/lib/1/hosted/office.js - @types/office-js - - office-ui-fabric-core@11.1.0/dist/css/fabric.min.css - office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css - - core-js@2.4.1/client/core.min.js - @types/core-js + https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts - jquery@3.1.1 - @types/jquery@3.3.1 + https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css + https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css diff --git a/samples/excel/30-events/events-table-changed.yaml b/samples/excel/30-events/events-table-changed.yaml index 10dbe4a25..3be83f9ac 100644 --- a/samples/excel/30-events/events-table-changed.yaml +++ b/samples/excel/30-events/events-table-changed.yaml @@ -6,12 +6,12 @@ host: EXCEL api_set: ExcelApi: '1.7' script: - content: |+ - $("#setup").on("click", () => tryCatch(setup)); - $("#register-on-changed-handler").on("click", () => tryCatch(registerOnChangedHandler)); - $("#change-data").on("click", () => tryCatch(changeData)); - $("#register-on-selection-changed-handler").on("click", () => tryCatch(registerOnSelectionChangedHandler)); - $("#change-selection").on("click", () => tryCatch(changeSelection)); + content: |- + document.getElementById("setup").addEventListener("click", () => tryCatch(setup)); + document.getElementById("register-on-changed-handler").addEventListener("click", () => tryCatch(registerOnChangedHandler)); + document.getElementById("change-data").addEventListener("click", () => tryCatch(changeData)); + document.getElementById("register-on-selection-changed-handler").addEventListener("click", () => tryCatch(registerOnSelectionChangedHandler)); + document.getElementById("change-selection").addEventListener("click", () => tryCatch(changeSelection)); async function registerOnChangedHandler() { await Excel.run(async (context) => { @@ -104,12 +104,9 @@ script: console.error(error); } } - - - language: typescript template: - content: |+ + content: >-This sample shows how to register and use event handlers for table onChanged and onSelectionChanged events.
This sample shows how to register and use an event handler for table collection onChanged event.
This sample shows how to register a workbook activated event handler.
Once the event handler is registered, a notification prints to the console when the workbook is activated. Try
@@ -66,15 +66,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/excel/30-events/events-workbook-and-worksheet-collection.yaml b/samples/excel/30-events/events-workbook-and-worksheet-collection.yaml
index 19b0ec0f8..4d3788c44 100644
--- a/samples/excel/30-events/events-workbook-and-worksheet-collection.yaml
+++ b/samples/excel/30-events/events-workbook-and-worksheet-collection.yaml
@@ -1,23 +1,24 @@
order: 14
id: excel-events-workbook-and-worksheet-collection
name: Workbook and worksheet collection events
-description: 'Registers event handlers that run when a worksheet is added, activated, or deactivated, or when the settings of a workbook are changed.'
+description: Registers event handlers that run when a worksheet is added,
+ activated, or deactivated, or when the settings of a workbook are changed.
author: OfficeDev
host: EXCEL
api_set:
ExcelApi: '1.7'
script:
content: |-
- $("#register-on-add-handler").on("click", () => tryCatch(registerOnAddHandler));
- $("#add-worksheet").on("click", () => tryCatch(addWorksheet));
+ document.getElementById("register-on-add-handler").addEventListener("click", () => tryCatch(registerOnAddHandler));
+ document.getElementById("add-worksheet").addEventListener("click", () => tryCatch(addWorksheet));
- $("#register-on-activate-handler").on("click", () => tryCatch(registerOnActivateHandler));
- $("#register-on-deactivate-handler").on("click", () => tryCatch(registerOnDeactivateHandler));
- $("#delete-worksheet").on("click", () => tryCatch(deleteWorksheet));
+ document.getElementById("register-on-activate-handler").addEventListener("click", () => tryCatch(registerOnActivateHandler));
+ document.getElementById("register-on-deactivate-handler").addEventListener("click", () => tryCatch(registerOnDeactivateHandler));
+ document.getElementById("delete-worksheet").addEventListener("click", () => tryCatch(deleteWorksheet));
- $("#create-setting").on("click", () => tryCatch(createSetting));
- $("#change-setting").on("click", () => tryCatch(changeSetting));
- $("#register-settings-changed-handler").on("click", () => tryCatch(registerSettingsChangedHandler));
+ document.getElementById("create-setting").addEventListener("click", () => tryCatch(createSetting));
+ document.getElementById("change-setting").addEventListener("click", () => tryCatch(changeSetting));
+ document.getElementById("register-settings-changed-handler").addEventListener("click", () => tryCatch(registerSettingsChangedHandler));
async function registerOnAddHandler() {
await Excel.run(async (context) => {
@@ -170,14 +171,13 @@ script:
}
language: typescript
template:
- content: |-
+ content: >-
This sample shows how to register and use handlers for when a worksheet is added, activated, or deactivated, or when the settings of a workbook are changed. Added Activated/Deactivated Settings This sample shows how to register a worksheet protection change event handler. Once the event handler is registered, you can enable and disable worksheet protection for the current worksheet. When worksheet protection is enabled, the current worksheet can't be edited.Try it out
-
Try it out
This sample shows how to register and use an event handler for the worksheet onSelectionChanged event.
Selection Changed
This sample shows how to register and use event handlers for table onChanged and onSelectionChanged events.
The console will log the addresses reported by the different onSelectionChanged events. Change the cell or cells selected in the worksheet to see the results. Try selecting single cells, multiple cells, and multiple discontiguous cells.
This sample shows how to create, access, and delete named items.
This sample shows how to create and update a named item.
This sample shows how to change the calculations of PivotTable data hierarchies.
This sample shows how to create PivotTables and add hierarchies to form rows, columns, and data sets.
Create the PivotTable
This sample shows how to filter PivotTables and manipulate their data.
Data Manipulation
This sample shows how to get PivotTables in the workbook. You can get them through PivotTableCollection objects or by querying a Range object containing PivotTable data.
@@ -185,15 +186,9 @@ style: min-width: 80px; } language: css -libraries: | +libraries: |- https://appsforoffice.microsoft.com/lib/1/hosted/office.js - @types/office-js - - office-ui-fabric-core@11.1.0/dist/css/fabric.min.css - office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css - - core-js@2.4.1/client/core.min.js - @types/core-js + https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts - jquery@3.1.1 - @types/jquery@3.3.1 \ No newline at end of file + https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css + https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css diff --git a/samples/excel/38-pivottable/pivottable-pivotfilters.yaml b/samples/excel/38-pivottable/pivottable-pivotfilters.yaml index b11672afe..2c9205c48 100644 --- a/samples/excel/38-pivottable/pivottable-pivotfilters.yaml +++ b/samples/excel/38-pivottable/pivottable-pivotfilters.yaml @@ -6,15 +6,31 @@ host: EXCEL api_set: ExcelAPI: '1.12' script: - content: | - $("#setup").on("click", () => tryCatch(setup)); - $("#manual-filter").on("click", () => tryCatch(manualFilter)); - $("#date-filter").on("click", () => tryCatch(dateFilter)); - $("#value-filter").on("click", () => tryCatch(valueFilter)); - $("#label-filter").on("click", () => tryCatch(labelFilter)); - $("#clear-filters").on("click", () => tryCatch(clearFilters)); - $("#log-filters").on("click", () => tryCatch(logFilters)); - $("#get-crate-total").on("click", () => tryCatch(getCrateTotal)); + content: >- + document.getElementById("setup").addEventListener("click", () => + tryCatch(setup)); + + document.getElementById("manual-filter").addEventListener("click", () => + tryCatch(manualFilter)); + + document.getElementById("date-filter").addEventListener("click", () => + tryCatch(dateFilter)); + + document.getElementById("value-filter").addEventListener("click", () => + tryCatch(valueFilter)); + + document.getElementById("label-filter").addEventListener("click", () => + tryCatch(labelFilter)); + + document.getElementById("clear-filters").addEventListener("click", () => + tryCatch(clearFilters)); + + document.getElementById("log-filters").addEventListener("click", () => + tryCatch(logFilters)); + + document.getElementById("get-crate-total").addEventListener("click", () + => tryCatch(getCrateTotal)); + async function manualFilter() { await Excel.run(async (context) => { @@ -40,6 +56,7 @@ script: }); } + async function dateFilter() { await Excel.run(async (context) => { // Add a date-based PivotFilter. @@ -70,6 +87,7 @@ script: }); } + async function valueFilter() { await Excel.run(async (context) => { // Add a PivotFilter to filter on the values correlated with a row. @@ -94,6 +112,7 @@ script: }); } + async function labelFilter() { await Excel.run(async (context) => { // Add a PivotFilter to filter based on the strings of item labels. @@ -118,6 +137,7 @@ script: }); } + async function clearFilters() { await Excel.run(async (context) => { // Clear all the PivotFilters. @@ -135,6 +155,7 @@ script: }); } + async function getCrateTotal() { await Excel.run(async (context) => { // Get the total amounts from the PivotTable. @@ -159,6 +180,7 @@ script: }); } + async function logFilters() { await Excel.run(async (context) => { // Display all the active PivotFilters. @@ -191,6 +213,7 @@ script: }); } + async function setup() { await Excel.run(async (context) => { // Create the worksheets. @@ -241,7 +264,9 @@ script: }); } + /** Default helper for invoking an action and handling errors. */ + async function tryCatch(callback) { try { await callback(); @@ -252,7 +277,7 @@ script: } language: typescript template: - content: |- + content: >-This sample shows how to filter PivotTables with the different PivotFilters.
PivotTable Status
This sample shows how to work with the PivotLayout class to display the PivotTable.
This sample shows how to refresh a PivotTable.
Add a row to the table, then refresh the PivotTable. Note that the PivotTable doesn't automatically refresh.
@@ -114,7 +125,7 @@ template:This sample shows how to work with a slicer on a PivotTable.
Add the slicer, then try out the formatting and filtering options.
@@ -188,7 +214,7 @@ template:This sample shows how to get information about the data source of a PivotTable. It returns the type and string representation of the data source.
Note: This sample works in Excel on Windows and Excel on the web. It doesn't work in Excel on Mac; this is a known issue.
@@ -106,7 +106,7 @@ template:This sample shows how to format a range.
This sample shows how to apply formulas that return dynamic arrays and how to get the relevant information about range spilling from the used ranges.
@@ -159,7 +160,7 @@ template:This sample shows how to format a range.
This sample shows how to insert, delete and clear the contents of a range.
This sample shows how to group and ungroup rows and columns for an outline.
This sample shows how to find and highlight the precedents of the currently selected cell.
Precedents are cells referenced by the formula in a cell. A formula can also reference a cell that contains a formula, which results in a series of precedents. A "direct precedent" is a cell directly referenced by the selected formula. This sample shows how to return both the direct precedents and all of the precedents.
This sample shows how to apply actions simultaneously to multiple, discontiguous ranges. Some of these ranges are found using the Range object's getSpecialCells method.
This sample shows how to provide cell data for surrounding cells using auto fill.
This sample shows how to copy data and formatting from one range (A1:E1) to another.
This sample shows how to find and highlight the dependents of the currently selected cell.
Dependent cells contain formulas that refer to other cells.
Cell D3 has dependents across worksheets.
@@ -145,10 +164,10 @@ template:This sample shows how to find and highlight the dependents of the currently selected cell. Dependent cells contain formulas that refer to other cells.
This sample shows how to find a cell with a matching string value within a range.
Enter text to search for in the box below and press Find text or Find text with null check to display the found text's address in the console.
@@ -159,13 +161,7 @@ style: language: css libraries: |- https://appsforoffice.microsoft.com/lib/1/hosted/office.js - @types/office-js - - office-ui-fabric-core@11.1.0/dist/css/fabric.min.css - office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css - - core-js@2.4.1/client/core.min.js - @types/core-js + https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts - jquery@3.1.1 - @types/jquery@3.3.1 \ No newline at end of file + https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css + https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css diff --git a/samples/excel/42-range/range-get-range-edge.yaml b/samples/excel/42-range/range-get-range-edge.yaml index e279163c5..59fd85e54 100644 --- a/samples/excel/42-range/range-get-range-edge.yaml +++ b/samples/excel/42-range/range-get-range-edge.yaml @@ -1,19 +1,20 @@ order: 20 id: excel-range-get-range-edge name: Select used range edge -description: 'This sample shows how to select the edges of the used range, based on the currently selected range.' +description: This sample shows how to select the edges of the used range, based + on the currently selected range. host: EXCEL api_set: ExcelAPI: '1.13' script: - content: | - $("#setup").on("click", () => tryCatch(setup)); - $("#select-E9").on("click", () => tryCatch(selectE9)); - $("#select-D8-E9").on("click", () => tryCatch(selectD8E9)); - $("#get-range-edge-left").on("click", () => tryCatch(getRangeEdgeLeft)); - $("#get-range-edge-up").on("click", () => tryCatch(getRangeEdgeUp)); - $("#get-extended-range-right").on("click", () => tryCatch(getExtendedRangeRight)); - $("#get-extended-range-down").on("click", () => tryCatch(getExtendedRangeDown)); + content: |- + document.getElementById("setup").addEventListener("click", () => tryCatch(setup)); + document.getElementById("select-E9").addEventListener("click", () => tryCatch(selectE9)); + document.getElementById("select-D8-E9").addEventListener("click", () => tryCatch(selectD8E9)); + document.getElementById("get-range-edge-left").addEventListener("click", () => tryCatch(getRangeEdgeLeft)); + document.getElementById("get-range-edge-up").addEventListener("click", () => tryCatch(getRangeEdgeUp)); + document.getElementById("get-extended-range-right").addEventListener("click", () => tryCatch(getExtendedRangeRight)); + document.getElementById("get-extended-range-down").addEventListener("click", () => tryCatch(getExtendedRangeDown)); async function getRangeEdgeLeft() { await Excel.run(async (context) => { @@ -169,10 +170,11 @@ script: } language: typescript template: - content: |- + content: >-This sample shows how to select the edges of the used range, based on the currently selected range.
This sample shows how to create, update, and clear a hyperlink for a range.
This sample shows how to create and find merged ranges in a worksheet.
This sample shows how to do various operations on ranges, for example, getting the bounding rect of two ranges.
This sample shows how to remove rows with duplicate column values from a range.
This sample shows how to set and get the text orientation within a range.
This sample shows how to get and set the currently selected range.
This sample shows how to set and get values and formulas for a range.
This sample shows how to add, apply, get and delete styles.
This sample creates a chart from a table, but only if there's data in the table.
This sample shows how to create different shapes, then delele them.
This sample shows how to group and upgroup shapes in a worksheet.
This sample shows how to change the position of shapes, both on the worksheet and their relative positioning when stacked.
This sample shows how to create and modify textboxes and other shapes with text.
This sample shows how to add columns and rows to a table.
This sample shows how to convert a range to a table.
This sample shows how to create a table.
This sample shows how to filter the data in a table using different filter types.
This sample shows how to format the different components of a table.
This sample shows how to get data from a table and write it to the sheet.
This sample shows how to filter the data in a table using different filter types.
This sample shows how to import json data into a new table.
This sample shows how to resize a table.
This sample shows how to sort the data in a table.
This sample shows how to create, get, change, and delete settings in the workbook.
This sample shows how to create a new, empty workbook and how to create a new workbook by copying an existing one.
This sample shows how to use the read-only cultural settings APIs to retrieve system date and time settings.
This sample shows how to apply the cultural settings APIs to help normalize data.
This sample shows how to protect a worksheet's data and the workbook's structure.
This sample shows how to use and nest the built-in Excel functions VLOOKUP and SUM. The sample uses VLOOKUP to return data, and then it uses SUM to combine data returned by VLOOKUP.
This sample shows how to use the calculation APIs.
Calculation events
Manual calculations
Try switching to manual calculation, then editing the workbook.
This sample shows how to get the active cell of the entire workbook.
This sample shows how to copy the worksheets from an existing workbook into the current workbook.
This sample shows how to save a workbook, both with and without a prompt to the user, and how to close the workbook.
This sample shows how to get and set the active worksheet.
This sample shows how to add, delete, rename and change the position of a worksheet.
This sample shows how to hide and show gridlines within a worksheet.
This sample shows how to list the names of the worksheets in the workbook.
This sample shows how to get a reference to a sheet using its relative worksheet position.
This sample shows how to set and get the tab color of a worksheet.
This sample shows how to work with an AutoFilter on a worksheet.
This sample shows how to copy a worksheet.
This sample shows how to find cells with matching string values across an entire worksheet.
This sample shows how to freeze columns, freeze rows, freeze a range, and manage frozen panes in a worksheet.
This sample shows how to change page layout and other settings for printing a worksheet.
In Excel, choose View > Page Layout, then observe the page layout changes as you press the following
@@ -202,15 +229,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/excel/54-worksheet/worksheet-range-cell.yaml b/samples/excel/54-worksheet/worksheet-range-cell.yaml
index b9a2c8040..0a47ac18f 100644
--- a/samples/excel/54-worksheet/worksheet-range-cell.yaml
+++ b/samples/excel/54-worksheet/worksheet-range-cell.yaml
@@ -1,19 +1,30 @@
order: 7
id: excel-worksheet-worksheet-range-cell
name: Get range or cell
-description: 'Gets the used range, the entire range of a worksheet, the specified range, and the specified cell.'
+description: Gets the used range, the entire range of a worksheet, the specified
+ range, and the specified cell.
author: OfficeDev
host: EXCEL
api_set:
ExcelApi: '1.4'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
+ content: >-
+ document.getElementById("setup").addEventListener("click", () =>
+ tryCatch(setup));
+
+
+ document.getElementById("get-used-range").addEventListener("click", ()
+ => tryCatch(getUsedRange));
+
+ document.getElementById("get-entire-range").addEventListener("click", ()
+ => tryCatch(getEntireRange));
+
+ document.getElementById("get-range").addEventListener("click", () =>
+ tryCatch(getRange));
+
+ document.getElementById("get-cell").addEventListener("click", () =>
+ tryCatch(getCell));
- $("#get-used-range").on("click", () => tryCatch(getUsedRange));
- $("#get-entire-range").on("click", () => tryCatch(getEntireRange));
- $("#get-range").on("click", () => tryCatch(getRange));
- $("#get-cell").on("click", () => tryCatch(getCell));
async function getUsedRange() {
await Excel.run(async (context) => {
@@ -27,6 +38,7 @@ script:
});
}
+
async function getEntireRange() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
@@ -39,6 +51,7 @@ script:
});
}
+
async function getRange() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
@@ -51,6 +64,7 @@ script:
});
}
+
async function getCell() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
@@ -63,6 +77,7 @@ script:
});
}
+
async function setup() {
await Excel.run(async (context) => {
context.workbook.worksheets.getItemOrNullObject("Sample").delete();
@@ -89,7 +104,9 @@ script:
});
}
+
/** Default helper for invoking an action and handling errors. */
+
async function tryCatch(callback) {
try {
await callback();
@@ -101,7 +118,7 @@ script:
}
language: typescript
template:
- content: |
+ content: >-
This sample shows how to get a range or a cell in a worksheet.
This sample shows how to change the visbility of a worksheet.
This sample shows how to format a range.
This sample shows some performance optimizations. Toggle the various performance options, then refresh or recalculate to see the effects.
@@ -160,6 +161,7 @@ template: Toggle calculation modeThis sample shows how to load sample data into the worksheet, and then create a chart.
This sample shows how to set and get date values in a range and manipulating them using the Moment JavaScript library with the Moment-MSDate plug-in.
Check whether there is a path from left to right, moving forward one cell at a time (and only straight or diagonally).
This sample lets you repeatedly stack tetrominos, which are represented by Shapes. Select a background image (or leave blank for the default) and Start!. The controls will then be displayed.
Select Background Image
@@ -784,17 +793,12 @@ style:
border: 1px solid black;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
- jquery@3.1.1
- @types/jquery@3.3.1
https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js
diff --git a/samples/excel/default.yaml b/samples/excel/default.yaml
index 27bfc38f6..58ed02628 100644
--- a/samples/excel/default.yaml
+++ b/samples/excel/default.yaml
@@ -6,8 +6,10 @@ host: EXCEL
api_set:
ExcelApi: '1.1'
script:
- content: |
- $("#run").on("click", () => tryCatch(run));
+ content: >-
+ document.getElementById("run").addEventListener("click", () =>
+ tryCatch(run));
+
async function run() {
await Excel.run(async (context) => {
@@ -19,7 +21,9 @@ script:
});
}
+
/** Default helper for invoking an action and handling errors. */
+
async function tryCatch(callback) {
try {
await callback();
@@ -31,7 +35,7 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
This sample shows how to set, save, and get add-in properties that can be accessed the next time the add-in is opened. This sample shows how to set, save, and get the custom per-item properties of an add-in. This sample adds an inline Base64-encoded image to the body of the message or appointment being composed. Required mode: Compose This sample appends text to the end of the message or appointment's body once it's sent. Required mode: Compose This sample gets the message or appointment's body format (plain text or HTML). Required mode: Compose This sample shows how to get the selected text in the item body or subject/title. Required mode: Compose This sample prepends text to the beginning of the message or appointment's body once it's sent. Required mode: Compose This sample adds text to the beginning of the message or appointment's body. Required mode: Compose This sample replaces selected text in a message or appointment's body with specified text. Required mode: Compose This sample shows how to close the current message being composed and discard any unsaved changes. Required mode: Message Compose This sample shows how to close the item in compose mode. This sample shows how to save the item in compose mode. This sample shows how to get all appointment attendees and organize them by their response. Required mode: Appointment Organizer, Appointment Read This sample shows how to get the Cc line recipients of the email. Required mode: Message Read This sample shows how to get who an email is from. Required mode: Message Compose This sample shows how to get who an email is from. In a delegate access scenario, the
from property represents the delegator. Tip: Use sender to get the delegate. This sample shows how to get the optional attendees. Required mode: Appointment Attendee This sample shows how to get the appointment organizer. Required mode: Appointment Attendee This sample shows how to get the appointment organizer. Required mode: Appointment Organizer This sample shows how to get the required attendees. Required mode: Appointment Attendee This sample shows how to get the email sender. In a delegate access scenario, the sender is the delegate. Tip: Use the from property to get the delegator. Required mode: Message Read This sample shows how to get and set the Bcc line recipients of the email. Required mode: Message Compose This sample shows how to get and set the Cc line recipients of the email. Required mode: Message Compose This sample shows how to get and set the optional attendees. Required mode: Appointment Organizer This sample shows how to get and set the required attendees. Required mode: Appointment Organizer This sample shows how to get and set the To line recipients of the email. Required mode: Message Compose This sample shows how to get the To line recipients of the email. Required mode: Message Read This sample shows how to add different kinds of notification messages, get all, replace, and remove an individual notification message. This sample shows how to add, get, and remove attachments from a message or an appointment in Compose mode. Required mode: Item Compose This sample gets the attachment content from a message or an appointment in read or compose mode. Required mode: Compose or Read This sample shows how to get the attachments of a message or an appointment in Read mode. Required mode: Item Read This sample shows how to get, add, and remove categories assigned to the item. This sample shows how to get, add, and remove master categories on the mailbox. This sample shows how to get the item's recurrence pattern, if any. Required modes: Appointment Attendee, Message Read This sample shows how to get the item's series ID, if any. This sample shows how to get and set the item's recurrence pattern, if any. Required mode: Appointment Organizer This sample shows how to display an existing appointment in a separate window. This sample shows how to display an existing message in a separate window. This sample shows how to display a new appointment and populate attendees, location, body, and a few other
properties. This sample shows how to display a new message, populate recipients, subject, and body, and add an inline image attachment. This sample shows how to create reply or reply-all messages and populate the body of the reply. This sample shows how to create a reply message and add an inline image attachment and an item attachment. Required mode: Compose This sample shows how to get and set the sensitivity label on a message or appointment being composed. To learn more about the sensitivity label API, see Manage the sensitivity label of your message or appointment in compose mode. Required mode: Compose This sample shows how to determine if sensitivity labels are enabled on the mailbox and retrieves all available labels from the catalog. To learn more about the sensitivity label API, see Manage the sensitivity label of your message or appointment in compose mode. Required mode: Compose This sample shows how to identify if the current mail item is in a shared folder or shared mailbox. This is done
by getting the item's shared properties. This sample shows how to get internet headers on a message in Read mode. Required mode: Message Read This sample shows how to set, get, and remove custom internet headers on a message in Compose mode. Required mode: Message Compose This sample shows how to get regex matches. Note: Contextual add-ins only support the use of an XML manifest. This feature isn't supported when your
@@ -66,7 +66,7 @@ template:
This sample uses Exchange Web Services (EWS) to get an appointment's iCalUId value if the user is an attendee. Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -59,7 +62,7 @@ template:
This sample uses Exchange Web Services (EWS) to get an appointment's iCalUId value if the user is the organizer. Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -75,15 +78,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml b/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml
index d7b4df2ac..9e13ee25f 100644
--- a/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml
+++ b/samples/outlook/85-tokens-and-service-calls/ids-and-urls.yaml
@@ -1,13 +1,14 @@
order: 1
id: outlook-tokens-and-service-calls-ids-and-urls
name: Endpoint URLs and item IDs
-description: 'Retrieves and displays the Exchange Web Services (EWS) endpoint URL and item IDs, and converts item IDs for different protocols.'
+description: Retrieves and displays the Exchange Web Services (EWS) endpoint URL
+ and item IDs, and converts item IDs for different protocols.
host: OUTLOOK
api_set:
Mailbox: '1.5'
script:
- content: |
- $("#run").on("click", run);
+ content: >-
+ document.getElementById("run").addEventListener("click", run);
function run() {
// Get the EWS URL and EWS item ID.
@@ -25,7 +26,7 @@ script:
}
language: typescript
template:
- content: |
+ content: >-
This sample shows how to retrieve the EWS endpoint URL and item IDs, and convert item IDs for different protocols. Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -42,7 +43,7 @@ template:
This sample shows how to get a message using EWS, without any back-end code. Important: This API is only supported in Exchange on-premises environments.
@@ -48,7 +48,7 @@ template:
This sample shows how to send a message using EWS, without any back-end code. Important: This API is only supported in Exchange on-premises environments.
@@ -51,7 +51,7 @@ template:
This sample shows how to get a callback token to call Outlook services from an add-in's backend service. Important: Exchange user identity and callback tokens are only supported in Exchange on-premises environments.
@@ -39,7 +41,7 @@ template:
This sample shows how to get a user identity token to use in authentication flows. Important: This API is only supported in Exchange on-premises environments.
@@ -38,7 +39,7 @@ template:
This sample gets and sets the delivery date and time of a message in compose mode. To learn more about this API, see Manage the delivery date and time of a message. Required mode: Compose This sample shows how to get and set the location of an appointment. Required modes: Appointment Organizer, Appointment Attendee This sample shows how to get the conversation ID of a message. Required modes: Message Compose, Message Read This sample shows how to get the Base64-encoded position of the current message in a conversation thread. Required mode: Message Compose This sample shows how to get the creation date and time of an item in Read mode. Required modes: Appointment Attendee, Message Read This sample shows how to get the last-modified date and time of an item in Read mode. Required modes: Appointment Attendee, Message Read This sample shows how to get a mailbox's diagnostic information. Required mode: Compose, Read This sample shows how to get the Base64-encoded EML format of a message in read mode. Required mode: Message Read This sample shows how to get the end date and time of an item in Read mode. Required modes: Appointment Attendee, Message Read (meeting request) This sample shows how to get the ID of the message being replied to by the current message. Required mode: Message Compose This sample shows how to get the internet message ID of a message in Read mode. Required mode: Message Read This sample shows how to get the Exchange Web Services (EWS) item class of the current message being composed. Required mode: Message Compose This sample shows how to get the item class of an item in Read mode. Required mode: Read This sample shows how to get the properties of the currently loaded message. Required mode: Message Compose, Message Read This sample shows how to get the location of an item in Read mode. Required modes: Appointment Attendee, Message Read (meeting request) This sample shows how to get the properties of multiple selected messages. Required mode: Message Compose, Message Read This sample shows how to get the normalized subject of an item in Read mode. Required modes: Appointment Attendee, Message Read This sample shows how to get and set the end date and time of an appointment in Compose mode. Required mode: Appointment Organizer This sample shows how to get and set the location of an appointment in Compose mode. Required mode: Appointment Organizer This sample shows how to get and set the sensitivity level of an appointment being composed.
@@ -50,6 +50,7 @@ template:
This sample shows how to get and set the start date and time of an appointment in Compose mode. Required mode: Appointment Organizer This sample shows how to set and get the subject of an item in Compose mode. Required mode: Compose This sample shows how to get the start date and time of an item in Read mode. Required modes: Appointment Attendee, Message Read (meeting request) This sample shows how to get the subject of an item in Read mode. Required mode: Read This sample shows how to get an item ID in compose mode. Required mode: Compose This sample shows how to programmatically send the current message or appointment being composed. Required mode: Compose This sample shows how to set, get, get all, remove, and clear session data in compose mode.
@@ -75,6 +89,7 @@ template:
This sample shows how to replace the selected text in the item body or subject/title. Required mode: Compose This sample shows how to check if the client signature is enabled, disable the client signature, get the compose
type, and set the signature.
@@ -136,15 +137,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml b/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml
index 7dbed18a8..cd2cbebdf 100644
--- a/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml
+++ b/samples/outlook/99-preview-apis/get-set-isalldayevent.yaml
@@ -6,9 +6,9 @@ host: OUTLOOK
api_set:
Mailbox: preview
script:
- content: |
- $("#getIsAllDayEvent").on("click", getIsAllDayEvent);
- $("#setIsAllDayEventTrue").on("click", setIsAllDayEventTrue);
+ content: |-
+ document.getElementById("getIsAllDayEvent").addEventListener("click", getIsAllDayEvent);
+ document.getElementById("setIsAllDayEventTrue").addEventListener("click", setIsAllDayEventTrue);
function getIsAllDayEvent() {
Office.context.mailbox.item.isAllDayEvent.getAsync(function(asyncResult) {
@@ -31,7 +31,7 @@ script:
}
language: typescript
template:
- content: |-
+ content: >-
This sample shows how to get and set the isAllDayEvent property of an appointment being composed.
@@ -47,6 +47,7 @@ template:
This sample shows how to temporarily set the content displayed in the body or subject of a
message in read mode. This sample shows how to create a new, empty presentation and how to create a new presentation by copying an existing one. Demonstrates how to get the hyperlinks located in a slide. Insert an image into the current slide. This sample shows how to insert an SVG image using an XML string as the source. This sample shows how to query external API (Wikipedia) with the text currently selected in the presentation. Select any text in the presentation and press Search to see related Wikipedia entries. This sample shows how to get selected shapes, and how to select and change specific shapes. This sample shows how select and change shapes based on their types. Create some shapes in a new, blank presentation. This sample shows how to create, resize, move, and delete shapes. Create, shrink, and move a shape. Create other shapes. This sample shows how to add a slide and optionally to specify the slide master and layout of the slide.Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
@@ -140,15 +154,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/outlook/90-other-item-apis/get-location-read.yaml b/samples/outlook/90-other-item-apis/get-location-read.yaml
index cc8bb5694..cd3fccdd2 100644
--- a/samples/outlook/90-other-item-apis/get-location-read.yaml
+++ b/samples/outlook/90-other-item-apis/get-location-read.yaml
@@ -6,19 +6,21 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get").on("click", get);
+ content: >-
+ document.getElementById("get").addEventListener("click", get);
+
function get() {
console.log(`Appointment location: ${Office.context.mailbox.item.location}`);
}
language: typescript
template:
- content: |-
+ content: >-
Try it out
Try it out
@@ -68,15 +70,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/outlook/90-other-item-apis/get-normalized-subject-read.yaml b/samples/outlook/90-other-item-apis/get-normalized-subject-read.yaml
index 19e517b81..eb7858e31 100644
--- a/samples/outlook/90-other-item-apis/get-normalized-subject-read.yaml
+++ b/samples/outlook/90-other-item-apis/get-normalized-subject-read.yaml
@@ -6,19 +6,21 @@ host: OUTLOOK
api_set:
Mailbox: '1.1'
script:
- content: |
- $("#get").on("click", get);
+ content: >-
+ document.getElementById("get").addEventListener("click", get);
+
function get() {
console.log(`Normalized subject: ${Office.context.mailbox.item.normalizedSubject}`);
}
language: typescript
template:
- content: |-
+ content: >-
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
');
@@ -29,8 +34,10 @@ script:
}
}
+
/* Searching Wiki */
+
function searchWiki(pattern) {
let url = build_wiki_search_url(pattern);
@@ -55,9 +62,12 @@ script:
});
}
+
// Search for Wiki Page link based on the given pageId
+
// Update itemHTML from the returned result
+
function getWikiLink(pageid, itemHTML) {
let pageinfo = build_wiki_pageinfo(pageid);
fetch(pageinfo)
@@ -84,9 +94,12 @@ script:
});
}
+
// Search for Wiki image based on the given pageId, first image
+
// Update itemHTML from the returned result
+
function getWikiImages(pageid, itemHTML) {
let pageInfo = build_wiki_image_search(pageid);
fetch(pageInfo)
@@ -122,38 +135,50 @@ script:
});
}
+
/* Wikipedia API query */
+
function wiki_base(pattern) {
const base_url = "https://en.wikipedia.org/w/api.php";
const base_query = "?origin=*&action=query&format=json&prop=";
return base_url + base_query + pattern;
}
+
/* Wikipedia Search Query pattern */
+
function build_wiki_search_url(pattern) {
let qry = "pageimages&list=search&srsearch=";
return wiki_base(qry + pattern);
}
+
/* Wikipedia Image Query pattern */
+
function build_wiki_image_search(pattern) {
let qry = "pageimages&piprop=original&pilicense=any&pageids=";
return wiki_base(qry + pattern);
}
+
/* Wikipedia File Query pattern */
+
function build_wiki_file_search(pattern) {
let qry = "pageimages|pageterms&pilicense=any&titles=";
return wiki_base(qry + pattern);
}
+
/* Wikipedia Page Info Query pattern */
+
function build_wiki_pageinfo(pattern) {
let qry = "info|images&inprop=url&pageids=";
return wiki_base(qry + pattern);
}
+
/* Render */
+
function build_list_item(title, pageid, summary, ts) {
return (
'
Search Wikipedia
Try it out
Result
Try it out
- Setup
Press Add slide to add a slide with the default layout of the default slide master to the end of the presentation.
Press Log slide masters info to log to the console a list of all the slide masters, their child layouts, and the IDs of the masters and the layouts.
Copy one of the slide master IDs from the console and enter it in the Master ID text box. (Example: 6147483651#7142061614)
-
Copy one of the layout IDs from the console, under the same master you choose above, and enter it in the Layout ID text box. (Example: 2147483651#3142061614)
-
Press Add slide again to add a slide with the corresponding master and layout.
+This sample shows how to get selected slides, and how to select specific slides.
Demonstrates how to get slide metadata.
Select one or more slides and click Get slide metadata to get the ID, title, and index of the slide(s).
@@ -43,17 +45,11 @@ style: margin-bottom: 5px; margin-left: 20px; min-width: 80px; - } + } language: css -libraries: | +libraries: |- https://appsforoffice.microsoft.com/lib/1/hosted/office.js - @types/office-js - - office-ui-fabric-core@11.1.0/dist/css/fabric.min.css - office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css - - core-js@2.4.1/client/core.min.js - @types/core-js + https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts - jquery@3.1.1 - @types/jquery@3.3.1 \ No newline at end of file + https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css + https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css diff --git a/samples/powerpoint/slide-management/insert-slides.yaml b/samples/powerpoint/slide-management/insert-slides.yaml index 67e2b85ed..5f35bac61 100644 --- a/samples/powerpoint/slide-management/insert-slides.yaml +++ b/samples/powerpoint/slide-management/insert-slides.yaml @@ -6,9 +6,9 @@ host: POWERPOINT api_set: PowerPointApi: '1.5' script: - content: | - $("#insert-all-slides").on("click", () => tryCatch(insertAllSlides)); - $("#insert-after-target-slide").on("click", () => tryCatch(insertAfterSelectedSlide)); + content: |- + document.getElementById("insert-all-slides").addEventListener("click", () => tryCatch(insertAllSlides)); + document.getElementById("insert-after-target-slide").addEventListener("click", () => tryCatch(insertAfterSelectedSlide)); $("#file").on("change", () => tryCatch(storeFileAsBase64)); let chosenFileBase64; @@ -67,7 +67,7 @@ script: } language: typescript template: - content: |- + content: >-This sample shows how to insert slides from another presentation into the current presentation.
These snippets show how to use tags with the presentation and its slides and shapes.
-1. Add several slides to the deck. Add content to each so they are visually distinct in the thumbnail pane.
-2. Select a single slide and press Add tag to tag the slide to be shown only to premium customers.
3. Repeat step 2 for another slide.
-4. Press Delete premium customer slides to remove from the presentation slides that should only be shown to premium customers.
5. Press Add slide tags to add mulitiple tags to the first slide of the presentation.
6. Select the first slide and on the ribbon, navigate Insert > Illustrations > Shapes to add a shape to it. Press Add shape tag.
7. Press Add presentation tag.
8. Press Delete presentation tag.
This sample shows how to get selected text, and how to select specific text.
+ Select an insertion point in the + document.
@@ -117,13 +128,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/word/25-paragraph/get-text.yaml b/samples/word/25-paragraph/get-text.yaml
index ebd2d19e3..5fb492b8e 100644
--- a/samples/word/25-paragraph/get-text.yaml
+++ b/samples/word/25-paragraph/get-text.yaml
@@ -1,15 +1,20 @@
order: 9
id: word-paragraph-get-text
name: Get text
-description: 'Shows how to get paragraph text, including hidden text and text marked for deletion.'
+description: Shows how to get paragraph text, including hidden text and text
+ marked for deletion.
author: OfficeDev
host: WORD
api_set:
WordApi: '1.7'
script:
- content: |
- $("#run").on("click", () => tryCatch(run));
- $("#setup").on("click", () => tryCatch(setup));
+ content: >-
+ document.getElementById("run").addEventListener("click", () =>
+ tryCatch(run));
+
+ document.getElementById("setup").addEventListener("click", () =>
+ tryCatch(setup));
+
async function run() {
await Word.run(async (context) => {
@@ -25,6 +30,7 @@ script:
});
}
+
async function setup() {
await Word.run(async (context) => {
const body: Word.Body = context.document.body;
@@ -40,7 +46,9 @@ script:
});
}
+
// Default helper for invoking an action and handling errors.
+
async function tryCatch(callback) {
try {
await callback();
@@ -51,7 +59,7 @@ script:
}
language: typescript
template:
- content: |-
+ content: >-
This sample demonstrates how to get paragraph text, including hidden text and text marked for deletion. This sample demonstrates how to manage a custom table style and use Document.importStylesFromJson.
This sample shows how to compare two documents: the current one and a specified external one. This sample shows how to insert the body text from an external document into the current document. This sample demonstrates how to manage annotations and use annotation events. Important: You need a Microsoft 365 subscription in order to use Annotation APIs. See GitHub issue 4953 for more information. This sample shows basic operations of the Track Changes feature. This sample shows basic operations using comments. This sample shows how to add, query, replace, edit, and delete a custom XML part in a document. Note: For your production add-in, make sure to create and host your own XML schema. This sample shows how to add, query, edit, and delete a custom XML part in a document. Note: For your production add-in, make sure to create and host your own XML schema. This sample demonstrates how to manage fields, which are placeholders for dynamic data in your document. To learn
more about fields, refer to Insert Date field
@@ -95,15 +103,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/word/25-paragraph/get-word-count.yaml b/samples/word/25-paragraph/get-word-count.yaml
index 91478aa3f..622ee1aef 100644
--- a/samples/word/25-paragraph/get-word-count.yaml
+++ b/samples/word/25-paragraph/get-word-count.yaml
@@ -7,9 +7,13 @@ host: WORD
api_set:
WordApi: '1.1'
script:
- content: |
- $("#setup").on("click", () => tryCatch(setup));
- $("#count").on("click", () => tryCatch(run));
+ content: >-
+ document.getElementById("setup").addEventListener("click", () =>
+ tryCatch(setup));
+
+ document.getElementById("count").addEventListener("click", () =>
+ tryCatch(run));
+
async function run() {
// Counts how many times each term appears in the document.
@@ -61,6 +65,7 @@ script:
});
}
+
async function setup() {
await Word.run(async (context) => {
const body: Word.Body = context.document.body;
@@ -76,7 +81,9 @@ script:
});
}
+
// Default helper for invoking an action and handling errors.
+
async function tryCatch(callback) {
try {
await callback();
@@ -87,7 +94,7 @@ script:
}
language: typescript
template:
- content: |-
+ content: >-
Set up
Try it out
Try it out
Set up
Try it out
Set up
Try it out
Try it out
Table formatting
@@ -233,13 +235,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/word/40-tables/table-cell-access.yaml b/samples/word/40-tables/table-cell-access.yaml
index 2651321bc..e27e07b23 100644
--- a/samples/word/40-tables/table-cell-access.yaml
+++ b/samples/word/40-tables/table-cell-access.yaml
@@ -7,9 +7,13 @@ host: WORD
api_set:
WordApi: '1.3'
script:
- content: |
- $("#run").on("click", () => tryCatch(getTableCell));
- $("#setup").on("click", () => tryCatch(insertTable));
+ content: >-
+ document.getElementById("run").addEventListener("click", () =>
+ tryCatch(getTableCell));
+
+ document.getElementById("setup").addEventListener("click", () =>
+ tryCatch(insertTable));
+
async function getTableCell() {
// Gets the content of the first cell in the first table.
@@ -22,6 +26,7 @@ script:
});
}
+
async function insertTable() {
await Word.run(async (context) => {
// Use a two-dimensional array to hold the initial table values.
@@ -37,7 +42,9 @@ script:
});
}
+
// Default helper for invoking an action and handling errors.
+
async function tryCatch(callback) {
try {
await callback();
@@ -52,14 +59,12 @@ template:
Set up
Try it out
This sample shows basic operations using footnotes.
This sample shows how to add, edit, get, and delete custom settings on a document. Settings created by an add-in
can
@@ -120,15 +131,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
-
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/word/50-document/manage-styles.yaml b/samples/word/50-document/manage-styles.yaml
index daf6afd8c..26b49310d 100644
--- a/samples/word/50-document/manage-styles.yaml
+++ b/samples/word/50-document/manage-styles.yaml
@@ -1,21 +1,40 @@
order: 12
id: word-document-manage-styles
name: Manage styles
-description: This sample shows how to perform operations on the styles in the current document and how to add and delete custom styles.
+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:
WordApiDesktop: '1.1'
script:
- content: |
- $("#count").on("click", () => tryCatch(getCount));
- $("#add-style").on("click", () => tryCatch(addStyle));
- $("#properties").on("click", () => tryCatch(getProperties));
- $("#apply-style").on("click", () => tryCatch(applyStyle));
- $("#font-properties").on("click", () => tryCatch(setFontProperties));
- $("#paragraph-format").on("click", () => tryCatch(setParagraphFormat));
- $("#border-properties").on("click", () => tryCatch(setBorderProperties));
- $("#shading-properties").on("click", () => tryCatch(setShadingProperties));
- $("#delete-style").on("click", () => tryCatch(deleteStyle));
+ content: >-
+ document.getElementById("count").addEventListener("click", () =>
+ tryCatch(getCount));
+
+ document.getElementById("add-style").addEventListener("click", () =>
+ tryCatch(addStyle));
+
+ document.getElementById("properties").addEventListener("click", () =>
+ tryCatch(getProperties));
+
+ document.getElementById("apply-style").addEventListener("click", () =>
+ tryCatch(applyStyle));
+
+ document.getElementById("font-properties").addEventListener("click", ()
+ => tryCatch(setFontProperties));
+
+ document.getElementById("paragraph-format").addEventListener("click", ()
+ => tryCatch(setParagraphFormat));
+
+ document.getElementById("border-properties").addEventListener("click",
+ () => tryCatch(setBorderProperties));
+
+ document.getElementById("shading-properties").addEventListener("click",
+ () => tryCatch(setShadingProperties));
+
+ document.getElementById("delete-style").addEventListener("click", () =>
+ tryCatch(deleteStyle));
+
async function getCount() {
// Gets the number of available styles stored with the document.
@@ -28,6 +47,7 @@ script:
});
}
+
async function addStyle() {
// Adds a new style.
await Word.run(async (context) => {
@@ -56,6 +76,7 @@ script:
});
}
+
async function getProperties() {
// Gets the properties of the specified style.
await Word.run(async (context) => {
@@ -81,6 +102,7 @@ script:
});
}
+
async function applyStyle() {
// Applies the specified style to a paragraph.
await Word.run(async (context) => {
@@ -112,6 +134,7 @@ script:
});
}
+
async function setFontProperties() {
// Updates font properties (e.g., color, size) of the specified style.
await Word.run(async (context) => {
@@ -136,6 +159,7 @@ script:
});
}
+
async function setParagraphFormat() {
// Sets certain aspects of the specified style's paragraph format e.g., the left indent size and the alignment.
await Word.run(async (context) => {
@@ -159,6 +183,7 @@ script:
});
}
+
async function setBorderProperties() {
// Updates border properties (e.g., type, width, color) of the specified style.
await Word.run(async (context) => {
@@ -187,6 +212,7 @@ script:
});
}
+
async function setShadingProperties() {
// Updates shading properties (e.g., texture, pattern colors) of the specified style.
await Word.run(async (context) => {
@@ -216,6 +242,7 @@ script:
});
}
+
async function deleteStyle() {
// Deletes the custom style.
await Word.run(async (context) => {
@@ -238,7 +265,9 @@ script:
});
}
+
// Default helper for invoking an action and handling errors.
+
async function tryCatch(callback) {
try {
await callback();
@@ -249,7 +278,7 @@ script:
}
language: typescript
template:
- content: |-
+ content: >-
@@ -281,7 +309,6 @@ template:
@@ -342,10 +367,6 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
- @types/office-js
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
- core-js@2.4.1/client/core.min.js
- @types/core-js
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/word/50-document/manage-tracked-changes.yaml b/samples/word/50-document/manage-tracked-changes.yaml
index 31796b541..ac11023a9 100644
--- a/samples/word/50-document/manage-tracked-changes.yaml
+++ b/samples/word/50-document/manage-tracked-changes.yaml
@@ -1,20 +1,21 @@
order: 5
id: word-document-manage-tracked-changes
name: Manage tracked changes
-description: 'This samples shows how to manage tracked changes, including accepting and rejecting changes.'
+description: This samples shows how to manage tracked changes, including
+ accepting and rejecting changes.
host: WORD
api_set:
WordApi: '1.6'
script:
- content: |
- $("#get-all-tracked-changes").on("click", () => tryCatch(getAllTrackedChanges));
- $("#get-first-tracked-change-range").on("click", () => tryCatch(getFirstTrackedChangeRange));
- $("#get-next-tracked-change").on("click", () => tryCatch(getNextTrackedChange));
- $("#accept-first-tracked-change").on("click", () => tryCatch(acceptFirstTrackedChange));
- $("#reject-first-tracked-change").on("click", () => tryCatch(rejectFirstTrackedChange));
- $("#accept-all-tracked-changes").on("click", () => tryCatch(acceptAllTrackedChanges));
- $("#reject-all-tracked-changes").on("click", () => tryCatch(rejectAllTrackedChanges));
- $("#setup").on("click", () => tryCatch(setup));
+ content: |-
+ document.getElementById("get-all-tracked-changes").addEventListener("click", () => tryCatch(getAllTrackedChanges));
+ document.getElementById("get-first-tracked-change-range").addEventListener("click", () => tryCatch(getFirstTrackedChangeRange));
+ document.getElementById("get-next-tracked-change").addEventListener("click", () => tryCatch(getNextTrackedChange));
+ document.getElementById("accept-first-tracked-change").addEventListener("click", () => tryCatch(acceptFirstTrackedChange));
+ document.getElementById("reject-first-tracked-change").addEventListener("click", () => tryCatch(rejectFirstTrackedChange));
+ document.getElementById("accept-all-tracked-changes").addEventListener("click", () => tryCatch(acceptAllTrackedChanges));
+ document.getElementById("reject-all-tracked-changes").addEventListener("click", () => tryCatch(rejectAllTrackedChanges));
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
async function getAllTrackedChanges() {
// Gets all tracked changes.
@@ -148,7 +149,7 @@ script:
}
language: typescript
template:
- content: |-
+ content: >-
First, choose the Add sample text button.
This sample shows how to use the options for saving and closing the current document. This sample demonstrates the performance optimization gained from the correlated objects pattern. For more information, see Avoid using the context.sync method in loops. This sample shows how to format text using the object.set method. This sample shows operations on comments and how to use comment events. Important: Comment events APIs are currently in preview. If this snippet doesn't work, try using
@@ -362,15 +363,9 @@ style:
min-width: 80px;
}
language: css
-libraries: |
+libraries: |-
https://appsforoffice.microsoft.com/lib/beta/hosted/office.js
@types/office-js-preview
- office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
-
- core-js@2.4.1/client/core.min.js
- @types/core-js
-
- jquery@3.1.1
- @types/jquery@3.3.1
\ No newline at end of file
+ https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
diff --git a/samples/word/default.yaml b/samples/word/default.yaml
index afde4ef92..6a8e696c8 100644
--- a/samples/word/default.yaml
+++ b/samples/word/default.yaml
@@ -6,8 +6,10 @@ host: WORD
api_set:
WordApi: '1.1'
script:
- content: |
- $("#run").on("click", () => tryCatch(run));
+ content: >-
+ document.getElementById("run").addEventListener("click", () =>
+ tryCatch(run));
+
async function run() {
await Word.run(async (context) => {
@@ -19,7 +21,9 @@ script:
});
}
+
// Default helper for invoking an action and handling errors.
+
async function tryCatch(callback) {
try {
await callback();
@@ -31,7 +35,7 @@ script:
}
language: typescript
template:
- content: |
+ content: |-
This sample demonstrates basic Excel API calls. Select some cells in the worksheet, then press Highlight selected range. This sample demonstrates basic Excel API calls. Select some cells in the worksheet, then press Highlight selected range. This sample uses the Common APIs compatible with Office 2013. Select a cell in the worksheet and press Write to console to see the contents of that cell in the console. This sample shows how to format the vertical and horizontal axis in a chart. This sample shows how to get, set, and remove axis unit, label and title in a chart. This sample shows how to create a bubble chart, with each chart series (or bubble) representing a single table row. This sample shows how to create column-clustered, line, XY-scatter, area, radar, pie, 3D, cylinder, and 100% charts. This sample shows how to get information about the data source of a chart series. Add a product table and line chart to a sample worksheet. Log information to the console about the data source of the chart series Frames. This sample shows how to add a data table to a chart and then format that data table. This sample shows how to change the plot order of series in a chart. This sample shows how to add, get, and format trendlines in a chart. This sample shows how to add, edit, and remove comments. To better view the comment changes, open the Comments pane by selecting Show Comments from the Review tab. This sample shows how to mention someone in a comment. IMPORTANT: This sample is currently only supported by Excel on the web. To better view the comment changes, open the Comments pane by selecting Show Comments from the Review tab. This sample shows how to add, edit, and remove comment replies. To better view the comment changes, open the Comments pane by selecting Show Comments from the Review tab. This sample shows how to resolve and reopen comment threads. To better view the comment changes, open the Comments pane by selecting Show Comments from the Review tab. This sample shows how to use priorities to work with conditional formatting of ranges when more than one conditional format
applies to some cells. This sample shows how to apply conditional formatting to ranges. This sample shows how to create, set, get, and delete custom XML parts in the file. Press the button to create and display Contoso's Reviewer metadata. This sample shows how to determine if there is just one XML part for a specified namespace. Press the "Create XML part" button to create and display Contoso's Reviewer metadata. Press it more than once if you want to set up an error situation. This sample shows how to set data provider attributions on entity values in the card layout. The data is aggregated from three different data providers, and three attributions are displayed. This sample shows how to display all the icons available for entity data types, along with the name of each icon. After creating the icons, select an icon to open the entity card for that data type. The entity cards in this sample display only the icon names. This sample shows how to create entity values for each row in a table. An entity value is a container for data types, similar to an object in object-oriented programming. In particular, this sample highlights the card layout options of an entity value, including the title, an image, collapsible sections, and nested entity values. This sample shows how to set the value of cell A1 to the #BUSY! error data type. The sample then checks to see if the worksheet contains a #BUSY! error, and then updates all cells that contain a #BUSY! error. This sample shows how to work with the formatted number data type. This sample shows how to create entity values with references to other entity values. An entity value is a container for data, and this container can reference (or contain) other entities within the original entity. One entity can contain multiple additional entities. To see referenced entities within an entity, take the following steps. This sample shows how to work with the web image data type. Insert an image into the selected cell and then
retrieve information about that image. Add a new worksheet and then enter the URL and alt text for an image of your choice. Select the cell you want to insert the web image into, and then select the Insert image button. This sample shows how to apply data validation to cells. Press Require approved name and then click on a cell in the Baby Name column and use the drop down to enter an approved value. This sample shows how to set and get custom properties at both the document level and the worksheet level. Enter the key/value pairs for your custom properties. Key: This sample shows how to get the Base64-encoded string that represents the current document. It uses the getFileAsync() method to read the file in slices and then joins all slices back together to form the complete file. This sample shows how to set and get document properties. This sample shows how to use table changed events. This sample shows how to register and use a handler for the data-changed event. This sample shows how to register and use handlers for the column and row sorting events. This sample shows how to register and use a handler for the single-click event. Use the button below to register the event handler. Then, left-click around the worksheet and check the console.
@@ -69,4 +67,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/30-events/events-chart-activated.yaml b/samples/excel/30-events/events-chart-activated.yaml
index fdcf85ec1..6ac14fd45 100644
--- a/samples/excel/30-events/events-chart-activated.yaml
+++ b/samples/excel/30-events/events-chart-activated.yaml
@@ -1,8 +1,7 @@
order: 2
id: excel-events-chart-activated
name: Chart events
-description: Registers event handlers on an individual chart that run when the
- chart is activated or deactivated.
+description: Registers event handlers on an individual chart that run when the chart is activated or deactivated.
host: EXCEL
api_set:
ExcelApi: '1.8'
@@ -136,18 +135,16 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
This sample shows how to register and use handlers for the Chart onActivated and onDeactivated events. Click the button to register handlers for the pie chart's activated and deactivated events. Then click the chart to activate it. Watch the console. Finally, click the cylinder chart to deactivate the pie chart. This sample shows how to register and use handlers for the ChartCollection onAdded, onDeleted, onActivated, and onDeactivated events. Click the button to register and use handlers for the worksheet's ChartCollection events. This sample shows how to register event handlers to listen for comment additions, changes, and deletions. In addition to hovering over a cell, you can view comment changes in the Comments pane by selecting Show Comments from the Review tab. This sample shows how to turn events on and off. The handlers update the "Grand Total" cell when events are fired (and enabled). Try editing the cells or refreshing the data with events enabled and disabled. This sample shows how to register a formula changed event handler and detect details about the changed formula. Set up the worksheet. This sample shows how to register and use event handlers for table onChanged and onSelectionChanged events. Changing data in a table triggers the data changed event. You can change the data manually or programmatically. Changing a range selection in a table triggers the table onSelectionChanged event. You can change selection manually or programmatically. This sample shows how to register and use an event handler for table collection onChanged event. Changing data in tables triggers the data changed event. You can change the data manually or programmatically. This sample shows how to register a workbook activated event handler. Once the event handler is registered, a notification prints to the console when the workbook is activated. Try
switching to another application and then switching back to Excel to see the console notification. This sample shows how to register and use handlers for when a worksheet is added, activated, or deactivated, or when the settings of a workbook are changed. Added This sample shows how to register a worksheet protection change event handler. Once the event handler is registered, you can enable and disable worksheet protection for the current worksheet. When worksheet protection is enabled, the current worksheet can't be edited. This sample shows how to register and use an event handler for the worksheet onSelectionChanged event. Selection Changed This sample shows how to register and use event handlers for table The console will log the addresses reported by the different This sample shows how to create, access, and delete named items. This sample shows how to change the calculations of PivotTable data hierarchies. This sample shows how to create PivotTables and add hierarchies to form rows, columns, and data sets. Create the PivotTable Adjust the PivotTable Adjust formatting Delete the PivotTable This sample shows how to filter PivotTables and manipulate their data. Change functions Filtering This sample shows how to get PivotTables in the workbook. You can get them through PivotTableCollection objects
or by querying a Range object containing PivotTable data. This creates a data sheet and two PivotTables in two different worksheets.
@@ -152,11 +150,9 @@ template:
Set up sample
This sample shows how to filter PivotTables with the different PivotFilters. Filters Manual filter This sample shows how to work with the PivotLayout class to display the PivotTable. This sample shows how to refresh a PivotTable. Add a row to the table, then refresh the PivotTable. Note that the PivotTable doesn't automatically refresh. This sample shows how to work with a slicer on a PivotTable. Add the slicer, then try out the formatting and filtering options. This sample shows how to get information about the data source of a PivotTable. It returns the type and string representation of the data source. Note: This sample works in Excel on Windows and Excel on the web. It doesn't work in Excel on Mac; this is a known issue. This sample shows how to format a range. This sample shows how to apply formulas that return dynamic arrays and how to get the relevant information
about range spilling from the used ranges. This sample shows how to insert, delete and clear the contents of a range. This sample shows how to group and ungroup rows and columns for an outline. This sample shows how to find and highlight the precedents of the currently selected cell. Precedents are cells referenced by the formula in a cell. A formula can also reference a cell that contains a formula, which results in a series of precedents. A "direct precedent" is a cell directly referenced by the selected formula. This sample shows how to return both the direct precedents and all of the precedents. This sample shows how to apply actions simultaneously to multiple, discontiguous ranges. Some of these ranges are found using the Range object's getSpecialCells method. This sample shows how to provide cell data for surrounding cells using auto fill. This sample shows how to copy data and formatting from one range (A1:E1) to another. This sample shows how to find and highlight the dependents of the currently selected cell. Dependent cells contain formulas that refer to other cells. Cell D3 has dependents across worksheets. This sample shows how to find and highlight the dependents of the currently selected cell. Dependent cells contain formulas that refer to other cells. Cells in the 'E' column have direct dependents on the same worksheet. Cells in the 'F' column have direct dependents on another worksheet. This sample shows how to find a cell with a matching string value within a range. Enter text to search for in the box below and press Find text or Find text with null check to display the found text's address in the console. This sample shows how to select the edges of the used range, based on the currently selected range. This sample shows how to create, update, and clear a hyperlink for a range. This sample shows how to create and find merged ranges in a worksheet. This sample shows how to do various operations on ranges, for example, getting the bounding rect of two ranges. This sample shows how to remove rows with duplicate column values from a range. This sample shows how to set and get the text orientation within a range. This sample shows how to get and set the currently selected range. This sample shows how to set and get values and formulas for a range. This sample shows how to add, apply, get and delete styles. Add new style will throw an error if the style has already been added. Delete new style throws an error if the style doesn't exist (that is, hasn't been added). Deleting the style also causes the other buttons using the style to fail. This sample creates a chart from a table, but only if there's data in the table. This sample shows how to create different shapes, then delele them. This sample shows how to group and upgroup shapes in a worksheet. This sample shows how to change the position of shapes, both on the worksheet and their relative positioning when stacked. This sample shows how to create and modify textboxes and other shapes with text. This sample shows how to add columns and rows to a table. Press the following buttons in order, so rows and columns of appropriate sizes are added. This sample shows how to filter the data in a table using different filter types. This sample shows how to format the different components of a table. This sample shows how to get data from a table and write it to the sheet. This sample shows how to filter the data in a table using different filter types. This sample shows how to create, get, change, and delete settings in the workbook. Press the button to create and display a setting. This sample shows how to create a new, empty workbook and how to create a new workbook by copying an existing one. Create empty workbook This sample shows how to use the read-only cultural settings APIs to retrieve system date and time settings. This sample shows how to apply the cultural settings APIs to help normalize data. This sample shows how to protect a worksheet's data and the workbook's structure. This sample shows how to use and nest the built-in Excel functions This sample shows how to use the calculation APIs. This sample shows how to get the active cell of the entire workbook. This sample shows how to copy the worksheets from an existing workbook into the current workbook. Select an Excel workbook to copy its worksheets into the current workbook. This sample shows how to save a workbook, both with and without a prompt to the user, and how to close the workbook. This sample shows how to add, delete, rename and change the position of a worksheet. This sample shows how to hide and show gridlines within a worksheet. This sample shows how to list the names of the worksheets in the workbook. This sample shows how to get a reference to a sheet using its relative worksheet position. Select any of the three worksheets for 2015, 1016, or 2017 and press the button to compare the tax due on the current sheet with the previous sheet. This sample shows how to set and get the tab color of a worksheet. This sample shows how to work with an AutoFilter on a worksheet. Add two filters. One shows only the top half of sales and the other shows only fruits that end with the letter 'e'. This sample shows how to find cells with matching string values across an entire worksheet. This sample shows how to freeze columns, freeze rows, freeze a range, and manage frozen panes in a worksheet. This sample shows how to change page layout and other settings for printing a worksheet. In Excel, choose View > Page Layout, then observe the page layout changes as you press the following
@@ -234,4 +207,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/54-worksheet/worksheet-range-cell.yaml b/samples/excel/54-worksheet/worksheet-range-cell.yaml
index 0a47ac18f..a26ccb9e3 100644
--- a/samples/excel/54-worksheet/worksheet-range-cell.yaml
+++ b/samples/excel/54-worksheet/worksheet-range-cell.yaml
@@ -1,30 +1,19 @@
order: 7
id: excel-worksheet-worksheet-range-cell
name: Get range or cell
-description: Gets the used range, the entire range of a worksheet, the specified
- range, and the specified cell.
+description: 'Gets the used range, the entire range of a worksheet, the specified range, and the specified cell.'
author: OfficeDev
host: EXCEL
api_set:
ExcelApi: '1.4'
script:
- content: >-
- document.getElementById("setup").addEventListener("click", () =>
- tryCatch(setup));
-
-
- document.getElementById("get-used-range").addEventListener("click", ()
- => tryCatch(getUsedRange));
-
- document.getElementById("get-entire-range").addEventListener("click", ()
- => tryCatch(getEntireRange));
-
- document.getElementById("get-range").addEventListener("click", () =>
- tryCatch(getRange));
-
- document.getElementById("get-cell").addEventListener("click", () =>
- tryCatch(getCell));
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("get-used-range").addEventListener("click", () => tryCatch(getUsedRange));
+ document.getElementById("get-entire-range").addEventListener("click", () => tryCatch(getEntireRange));
+ document.getElementById("get-range").addEventListener("click", () => tryCatch(getRange));
+ document.getElementById("get-cell").addEventListener("click", () => tryCatch(getCell));
async function getUsedRange() {
await Excel.run(async (context) => {
@@ -38,7 +27,6 @@ script:
});
}
-
async function getEntireRange() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
@@ -51,7 +39,6 @@ script:
});
}
-
async function getRange() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
@@ -64,7 +51,6 @@ script:
});
}
-
async function getCell() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
@@ -77,7 +63,6 @@ script:
});
}
-
async function setup() {
await Excel.run(async (context) => {
context.workbook.worksheets.getItemOrNullObject("Sample").delete();
@@ -104,9 +89,7 @@ script:
});
}
-
/** Default helper for invoking an action and handling errors. */
-
async function tryCatch(callback) {
try {
await callback();
@@ -118,18 +101,16 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
This sample shows how to get a range or a cell in a worksheet. Simple currency converter shows how to read data from a transaction table, and uses currency converter API to
calculate the amount in base currency. The code also performs table validation and identify if the table has predefined headers. You can try to to rearrange the the
column, and see by yourself! The currency conversion is provided by exchangeratesapi.io which uses
@@ -214,4 +184,4 @@ libraries: |-
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
moment@2.18.1
- moment-msdate@0.2.2
+ moment-msdate@0.2.2
\ No newline at end of file
diff --git a/samples/excel/90-scenarios/multiple-property-set.yaml b/samples/excel/90-scenarios/multiple-property-set.yaml
index f9ac64618..e74a52b5c 100644
--- a/samples/excel/90-scenarios/multiple-property-set.yaml
+++ b/samples/excel/90-scenarios/multiple-property-set.yaml
@@ -94,18 +94,16 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
This sample shows how to format a range. This sample shows some performance optimizations. Toggle the various performance options, then refresh or
recalculate to see the effects. This sample shows how to load sample data into the worksheet, and then create a chart. This sample shows how to set and get date values in a range and manipulating them using the Moment JavaScript library with the Moment-MSDate plug-in. Check whether there is a path from left to right, moving forward one cell at a time (and only straight or diagonally). This sample lets you repeatedly stack tetrominos, which are represented by Shapes. Select a background image (or leave blank for the default) and Start!. The controls will then be displayed. This sample shows how to set, save, and get add-in properties that can be accessed the next time the add-in is opened. This sample shows how to set, save, and get the custom per-item properties of an add-in. First load the -
- document.getElementById("prepend-image").addEventListener("click",
- prependImage);
-
- document.getElementById("append-image").addEventListener("click",
- appendImage);
-
+ content: |-
+ document.getElementById("prepend-image").addEventListener("click", prependImage);
+ document.getElementById("append-image").addEventListener("click", appendImage);
const base64String =
"iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAnUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN0S+bUAAAAMdFJOUwAQIDBAUI+fr7/P7yEupu8AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF8SURBVGhD7dfLdoMwDEVR6Cspzf9/b20QYOthS5Zn0Z2kVdY6O2WULrFYLBaLxd5ur4mDZD14b8ogWS/dtxV+dmx9ysA2QUj9TQRWv5D7HyKwuIW9n0vc8tkpHP0W4BOg3wQ8wtlvA+PC1e8Ao8Ld7wFjQtHvAiNC2e8DdqHqKwCrUPc1gE1AfRVgEXBfB+gF0lcCWoH2tYBOYPpqQCNwfT3QF9i+AegJfN8CtAWhbwJagtS3AbIg9o2AJMh9M5C+SVGBvx6zAfmT0r+Bv8JMwP4kyFPir+cswF5KL3WLv14zAFBCLf56Tw9cparFX4upgaJUtPhrOS1QlY5W+vWTXrGgBFB/b72ev3/0igUdQPppP/nfowfKUUEFcP207y/yxKmgAYQ+PywoAFOfCH3A2MdCFzD3kdADBvq10AGG+pXQBgb7pdAEhvuF0AIc/VtoAK7+JciAs38KIuDugyAC/v4hiMCE/i7IwLRBsh68N2WQjMVisVgs9i5bln8LGScNcCrONQAAAABJRU5ErkJggg==";
@@ -37,7 +32,6 @@ script:
});
}
-
function appendImage() {
// Get the current body of the message or appointment.
Office.context.mailbox.item.body.getAsync(Office.CoercionType.Html, (bodyResult) => {
@@ -70,12 +64,11 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
This sample adds an inline Base64-encoded image to the body of the message or appointment being composed. Required mode: Compose This sample appends text to the end of the message or appointment's body once it's sent. Required mode: Compose Important: To use This sample gets the message or appointment's body format (plain text or HTML). Required mode: Compose This sample shows how to get the selected text in the item body or subject/title. Required mode: Compose Select text in the item body or subject then push the Get selected text button. This sample prepends text to the beginning of the message or appointment's body once it's sent. Required mode: Compose Important: To use This sample adds text to the beginning of the message or appointment's body. Required mode: Compose This sample replaces selected text in a message or appointment's body with specified text. Required mode: Compose This sample shows how to close the current message being composed and discard any unsaved changes. Required mode: Message Compose This sample shows how to get all appointment attendees and organize them by their response. Required mode: Appointment Organizer, Appointment Read This sample shows how to get the Cc line recipients of the email. Required mode: Message Read This sample shows how to get who an email is from. Required mode: Message Compose This sample shows how to get who an email is from. In a delegate access scenario, the
from property represents the delegator. Tip: Use sender to get the delegate. Required mode: Message Read This sample shows how to get the optional attendees. Required mode: Appointment Attendee This sample shows how to get the appointment organizer. Required mode: Appointment Attendee This sample shows how to get the appointment organizer. Required mode: Appointment Organizer This sample shows how to get the required attendees. Required mode: Appointment Attendee This sample shows how to get the email sender. In a delegate access scenario, the sender is the delegate. Tip: Use the from property to get the delegator. Required mode: Message Read This sample shows how to get and set the Bcc line recipients of the email. Required mode: Message Compose This sample shows how to get and set the Cc line recipients of the email. Required mode: Message Compose This sample shows how to get and set the optional attendees. Required mode: Appointment Organizer This sample shows how to get and set the required attendees. Required mode: Appointment Organizer This sample shows how to get and set the To line recipients of the email. Required mode: Message Compose This sample shows how to get the To line recipients of the email. Required mode: Message Read This sample shows how to add different kinds of notification messages, get all, replace, and remove an individual notification message. This sample shows how to add, get, and remove attachments from a message or an appointment in Compose mode. Required mode: Item Compose This sample gets the attachment content from a message or an appointment in read or compose mode. Required mode: Compose or Read This sample shows how to get the attachments of a message or an appointment in Read mode. Required mode: Item Read This sample shows how to get, add, and remove categories assigned to the item.Try it out
Try it out
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Setup
Try it out
Setup
@@ -65,7 +64,6 @@ template:
Create a worksheet
Try it out
Setup
Try it out
Setup
Try it out
Set up
Try it out
@@ -229,4 +227,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/14-conditional-formatting/conditional-formatting-basic.yaml b/samples/excel/14-conditional-formatting/conditional-formatting-basic.yaml
index ef169c239..23f0d65e7 100644
--- a/samples/excel/14-conditional-formatting/conditional-formatting-basic.yaml
+++ b/samples/excel/14-conditional-formatting/conditional-formatting-basic.yaml
@@ -273,18 +273,16 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
Set up
Try it out
@@ -346,4 +344,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/16-custom-functions/custom-functions-errors.yaml b/samples/excel/16-custom-functions/custom-functions-errors.yaml
index cccba8f42..e1f5582b1 100644
--- a/samples/excel/16-custom-functions/custom-functions-errors.yaml
+++ b/samples/excel/16-custom-functions/custom-functions-errors.yaml
@@ -6,23 +6,15 @@ host: EXCEL
api_set:
CustomFunctionsRuntime: 1.2
script:
- content: >-
+ content: |-
/**
-
* Returns the #NUM! error as part of a 2-dimensional array.
-
* @customfunction
-
* @param {number} first First parameter.
-
* @param {number} second Second parameter.
-
* @param {number} third Third parameter.
-
* @returns {number[][]} Three results, as a 2-dimensional array.
-
*/
-
function returnInvalidNumberError(first, second, third) {
// Use the `CustomFunctions.Error` object to retrieve an invalid number error.
const error = new CustomFunctions.Error(
@@ -43,4 +35,4 @@ script:
libraries: |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js
- core-js@2.4.1/client/core.min.js
+ core-js@2.4.1/client/core.min.js
\ No newline at end of file
diff --git a/samples/excel/16-custom-functions/data-types-custom-functions.yaml b/samples/excel/16-custom-functions/data-types-custom-functions.yaml
index 7239d7a89..a5ebdbab6 100644
--- a/samples/excel/16-custom-functions/data-types-custom-functions.yaml
+++ b/samples/excel/16-custom-functions/data-types-custom-functions.yaml
@@ -1,13 +1,12 @@
order: 6
id: excel-data-types-custom-functions
name: 'Data types: Custom functions'
-description: This sample shows how to write custom functions that return entity
- value data types.
+description: This sample shows how to write custom functions that return entity value data types.
host: EXCEL
api_set:
CustomFunctionsRuntime: 1.4
script:
- content: >
+ content: |
/**
* Search for products that match a given substring. Try =SCRIPTLAB.DATATYPESCUSTOMFUNCTIONS.PRODUCTSEARCH("chef", false).
* @customfunction
@@ -15,8 +14,7 @@ script:
* @param {boolean} [completeMatch] Define whether the search should be a match of the whole product name or part of the product name. If omitted, completeMatch = false.
* @return {PromiseTry it out
XML part display
Try it out
XML part display
Set up
Try it out
Set up
Run sample
Set up
Try it out
Set up
Set up
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Create a new workbook
Try it out
Setup
Try it out
Set up
Try it out
Set up
Try it out
Try it out
Set up
Try it out
Set up
Try it out
Setup
Try it out
Setup
Try it out
Try it out
Set up
Try it out
Set up
Try it out
Try it out
Try it out
Try it out
Set up
Try it out
onChanged and onSelectionChanged events.Set up
WorksheetCollectionTry it out
onSelectionChanged events. Change the cell or cells selected in the worksheet to see the results. Try selecting single cells, multiple cells, and multiple discontiguous cells.Setup
Set up
Try it out
Clean up
Set up
Try it out
Set up
Try it out
Clean up
Set up
Try it out
Set up
Try it out
Set up
Try it out
Setup
Try it out
Setup
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Set up
Try it out
Setup
Try it out
Set up
Try it out
Set up
Try it out
Setup
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
@@ -118,4 +116,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/42-range/selected-range.yaml b/samples/excel/42-range/selected-range.yaml
index 9fc12e71d..6ae16734d 100644
--- a/samples/excel/42-range/selected-range.yaml
+++ b/samples/excel/42-range/selected-range.yaml
@@ -7,13 +7,9 @@ host: EXCEL
api_set:
ExcelApi: '1.1'
script:
- content: >-
- document.getElementById("get-selection").addEventListener("click", () =>
- tryCatch(getSelection));
-
- document.getElementById("set-selection").addEventListener("click", () =>
- tryCatch(setSelection));
-
+ content: |-
+ document.getElementById("get-selection").addEventListener("click", () => tryCatch(getSelection));
+ document.getElementById("set-selection").addEventListener("click", () => tryCatch(setSelection));
async function getSelection() {
await Excel.run(async (context) => {
@@ -26,7 +22,6 @@ script:
});
}
-
async function setSelection() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getActiveWorksheet();
@@ -38,9 +33,7 @@ script:
});
}
-
/** Default helper for invoking an action and handling errors. */
-
async function tryCatch(callback) {
try {
await callback();
@@ -52,11 +45,10 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
Try it out
Set up
Try it out
Set up
Try it out
Clean up
Set up
Try it out
Setup
Try it out
Setup
Try it out
Setup
Try it out
Setup
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Set up
Try it out
Try it out
Try it out
Setup
Try it out
Setup
Try it out
Set up
Try it out
Protect without password
@@ -256,4 +254,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/50-workbook/workbook-built-in-functions.yaml b/samples/excel/50-workbook/workbook-built-in-functions.yaml
index c1055f0ec..3490d043b 100644
--- a/samples/excel/50-workbook/workbook-built-in-functions.yaml
+++ b/samples/excel/50-workbook/workbook-built-in-functions.yaml
@@ -6,16 +6,10 @@ host: EXCEL
api_set:
ExcelAPI: '1.2'
script:
- content: >-
- document.getElementById("setup").addEventListener("click", () =>
- tryCatch(setup));
-
- document.getElementById("call-vlookup").addEventListener("click", () =>
- tryCatch(callVlookup));
-
- document.getElementById("nest-functions").addEventListener("click", ()
- => tryCatch(nestFunctions));
-
+ content: |-
+ document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
+ document.getElementById("call-vlookup").addEventListener("click", () => tryCatch(callVlookup));
+ document.getElementById("nest-functions").addEventListener("click", () => tryCatch(nestFunctions));
async function callVlookup() {
await Excel.run(async (context) => {
@@ -31,7 +25,6 @@ script:
});
}
-
async function nestFunctions() {
await Excel.run(async (context) => {
// This function uses VLOOKUP to find data in the "Wrench" row
@@ -52,7 +45,6 @@ script:
});
}
-
async function setup() {
await Excel.run(async (context) => {
context.workbook.worksheets.getItemOrNullObject("Sample").delete();
@@ -76,9 +68,7 @@ script:
});
}
-
/** Default helper for invoking an action and handling errors. */
-
async function tryCatch(callback) {
try {
await callback();
@@ -89,11 +79,10 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
VLOOKUP and SUM. The sample uses VLOOKUP to return data, and then it uses SUM to combine data returned by VLOOKUP.Setup
Set up
Try it out
Try it out
Try it out
Try it out
Try it out
@@ -83,4 +75,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/54-worksheet/list-worksheets.yaml b/samples/excel/54-worksheet/list-worksheets.yaml
index 6607ee616..d179c4d50 100644
--- a/samples/excel/54-worksheet/list-worksheets.yaml
+++ b/samples/excel/54-worksheet/list-worksheets.yaml
@@ -7,10 +7,8 @@ host: EXCEL
api_set:
ExcelApi: '1.1'
script:
- content: >-
- document.getElementById("list-worksheets").addEventListener("click", ()
- => tryCatch(listWorksheets));
-
+ content: |-
+ document.getElementById("list-worksheets").addEventListener("click", () => tryCatch(listWorksheets));
async function listWorksheets() {
await Excel.run(async (context) => {
@@ -30,9 +28,7 @@ script:
});
}
-
/** Default helper for invoking an action and handling errors. */
-
async function tryCatch(callback) {
try {
await callback();
@@ -44,11 +40,10 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
Try it out
Set up
Try it out
Try it out
@@ -106,4 +105,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/excel/54-worksheet/worksheet-auto-filter.yaml b/samples/excel/54-worksheet/worksheet-auto-filter.yaml
index 0de48e6c0..a4e887a21 100644
--- a/samples/excel/54-worksheet/worksheet-auto-filter.yaml
+++ b/samples/excel/54-worksheet/worksheet-auto-filter.yaml
@@ -152,18 +152,16 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
Setup
Try it out
Setup
Try it out
Set up
Try it out
Setup
Try it out
Set up
Try it out
Simple Currency Converter
Set up
Try it out
Set up
Try it out
Setup
Performance settings
Try it out
Try it out
Set up
Try it out
Color configuration
Set up
-
-
Find the path:
-
Try it out
Try it out
Try it out
Try it out
appendOnSendAsync, you must set AppendOnSend as an extended permission in the ExtendedPermissions manifest element. To learn more about append-on-send and its configuration, see Implement append-on-send in your Outlook add-in.Try it out
Try it out
Try it out
prependOnSendAsync, you must set AppendOnSend as an extended permission in the ExtendedPermissions manifest element. appendOnSendAsync and prependOnSendAsync both use the AppendOnSend extended permission. To learn more about prepend-on-send, see Prepend or append content to a message or appointment body on send.Try it out
Try it out
@@ -79,4 +75,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/25-item-save-and-close/close-async.yaml b/samples/outlook/25-item-save-and-close/close-async.yaml
index 107e59f05..109be2bbd 100644
--- a/samples/outlook/25-item-save-and-close/close-async.yaml
+++ b/samples/outlook/25-item-save-and-close/close-async.yaml
@@ -6,10 +6,8 @@ host: OUTLOOK
api_set:
Mailbox: '1.14'
script:
- content: >-
- document.getElementById("close-async").addEventListener("click",
- closeAsync);
-
+ content: |-
+ document.getElementById("close-async").addEventListener("click", closeAsync);
function closeAsync() {
// This snippet closes the current message being composed and discards any unsaved changes when the optional property, discardItem, is set to true.
@@ -26,12 +24,11 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
Try it out
@@ -172,4 +161,4 @@ libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
- https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
+ https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
\ No newline at end of file
diff --git a/samples/outlook/40-attachments/get-attachment-content.yaml b/samples/outlook/40-attachments/get-attachment-content.yaml
index 5c44ec966..5e62a33dd 100644
--- a/samples/outlook/40-attachments/get-attachment-content.yaml
+++ b/samples/outlook/40-attachments/get-attachment-content.yaml
@@ -77,12 +77,11 @@ script:
}
language: typescript
template:
- content: >-
+ content: |-
Try it out
Try it out
Try it out