Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions docs/docs-ref-autogen/preview-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Office Scripts preview APIs
description: Details about upcoming Office Scripts APIs.
ms.topic: whats-new
ms.date: 08/26/2025
ms.date: 09/08/2025
---

# Office Scripts preview APIs
Expand All @@ -22,23 +22,7 @@ The following table provides a concise summary of the APIs, while the subsequent

The following table lists the Office Scripts APIs currently in preview.

| Namespace | Class | Fields | Description |
|:---|:---|:---|:---|
| [OfficeScript](/javascript/api/office-scripts/officescript) | | [convertToPdf()](/javascript/api/office-scripts/officescript#officescript-officescript-converttopdf-function(1)) | Return the text encoding of the document as a PDF. If the document is empty, then the following error is shown: "We didn't find anything to print". Some actions made prior to using this API may not be captured in the PDF in Excel on the web. |
| | | [downloadFile({ name, content, })](/javascript/api/office-scripts/officescript#officescript-officescript-downloadfile-function(1)) | Downloads a specified file to the default download location specified by the local machine. |
| | | [Metadata.getScriptName()](/javascript/api/office-scripts/officescript#officescript-officescript-metadata-getscriptname-function(1)) | Get the name of the currently running script. |
| | | [saveCopyAs(filename)](/javascript/api/office-scripts/officescript#officescript-officescript-savecopyas-function(1)) | Saves a copy of the current workbook in OneDrive, in the same directory as the original file, with the specified file name. The API has a timeout limit of 30 seconds. This limit is rarely exceeded. |
| | | [sendMail(mailProperties)](/javascript/api/office-scripts/officescript#officescript-officescript-sendmail-function(1)) | Send an email with an Office Script. Use MailProperties to specify the content and recipients of the email. If the request body includes content, this method returns 400 Bad request. |
| [OfficeScript](/javascript/api/office-scripts/officescript) | [EmailAttachment](/javascript/api/office-scripts/officescript/officescript.emailattachment) | [content](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-content-member) | The contents of the file. |
| | | [name](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-name-member) | The text that is displayed below the icon representing the attachment. This string doesn't need to match the file name. |
| [OfficeScript](/javascript/api/office-scripts/officescript) | [MailProperties](/javascript/api/office-scripts/officescript/officescript.mailproperties) | [attachments](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-attachments-member) | A file (such as a text file or Excel workbook) attached to a message. Optional. |
| | | [bcc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-bcc-member) | The blind carbon copy (BCC) recipient or recipients of the email. Optional. |
| | | [cc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-cc-member) | The carbon copy (CC) recipient or recipients of the email. Optional. |
| | | [content](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-content-member) | The content of the email. Optional. |
| | | [contentType](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-contentType-member) | The type of the content in the email. Possible values are text or HTML. Optional. |
| | | [importance](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-importance-member) | The importance of the email. The possible values are `low`, `normal`, and `high`. Default value is `normal`. Optional. |
| | | [subject](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-subject-member) | The subject of the email. Optional. |
| | | [to](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-to-member) | The direct recipient or recipients of the email. Optional. |
[!INCLUDE[API table](../includes/officescript-preview.md)]

## See also

Expand Down
2 changes: 2 additions & 0 deletions docs/docs-ref-autogen/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ items:
items:
- name: API reference overview
href: overview.md
- name: Preview APIs
href: preview-apis.md
- name: ExcelScript
uid: ExcelScript!
items:
Expand Down
2 changes: 2 additions & 0 deletions docs/includes/excelscript-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| Class | Fields | Description |
|:---|:---|:---|
17 changes: 17 additions & 0 deletions docs/includes/officescript-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
| Class | Fields | Description |
|:---|:---|:---|
|*global*|[convertToPdf()](/javascript/api/office-scripts/officescript#officescript-officescript-converttopdf-function(1))|Return the text encoding of the document as a PDF.|
||[downloadFile({ name, content, }: { name: string content: string })](/javascript/api/office-scripts/officescript#officescript-officescript-downloadfile-function(1))|Downloads a specified file to the default download location specified by the local machine.|
||[getScriptName()](/javascript/api/office-scripts/officescript#officescript-officescript-getscriptname-function(1))|Get the name of the currently running script.|
||[saveCopyAs(filename: string)](/javascript/api/office-scripts/officescript#officescript-officescript-savecopyas-function(1))|Saves a copy of the current workbook in OneDrive, in the same directory as the original file, with the specified file name.|
||[sendMail(mailProperties: MailProperties)](/javascript/api/office-scripts/officescript#officescript-officescript-sendmail-function(1))|Send an email with an Office Script.|
|[EmailAttachment](/javascript/api/office-scripts/officescript/officescript.emailattachment)|[content](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-content-member)|The contents of the file.|
||[name](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-name-member)|The text that is displayed below the icon representing the attachment.|
|[MailProperties](/javascript/api/office-scripts/officescript/officescript.mailproperties)|[attachments](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-attachments-member)|A file (such as a text file or Excel workbook) attached to a message.|
||[bcc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-bcc-member)|The blind carbon copy (BCC) recipient or recipients of the email.|
||[cc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-cc-member)|The carbon copy (CC) recipient or recipients of the email.|
||[content](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-content-member)|The content of the email.|
||[contentType](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-contenttype-member)|The type of the content in the email.|
||[importance](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-importance-member)|The importance of the email.|
||[subject](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-subject-member)|The subject of the email.|
||[to](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-to-member)|The direct recipient or recipients of the email.|
25 changes: 22 additions & 3 deletions generate-docs/GenerateDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ if [ -d "json" ]; then
rm -rf "json"
fi

mkdir json
mkdir -p json/json-preview
mkdir -p json/json-release

if [ -d "yaml" ]; then
rm -rf "yaml"
fi

mkdir yaml
mkdir -p yaml/yaml-preview
mkdir -p yaml/yaml-release

npm install

Expand All @@ -27,6 +29,14 @@ npm run build
node preprocessor.js
popd

# Create release versions by removing @beta APIs
./node_modules/.bin/version-remover api-extractor-inputs-excelscript/excelscript.d.ts api-extractor-inputs-excelscript-release/excelscript.d.ts "@beta"
./node_modules/.bin/version-remover api-extractor-inputs-officescript/officescript.d.ts api-extractor-inputs-officescript-release/officescript.d.ts "@beta"

# Generate what's new reports comparing preview vs release
./node_modules/.bin/whats-new api-extractor-inputs-excelscript/excelscript.d.ts api-extractor-inputs-excelscript-release/excelscript.d.ts ../docs/includes/excelscript-preview javascript/api/office-scripts/excelscript. office-scripts-link-config.json
./node_modules/.bin/whats-new api-extractor-inputs-officescript/officescript.d.ts api-extractor-inputs-officescript-release/officescript.d.ts ../docs/includes/officescript-preview javascript/api/office-scripts/officescript. office-scripts-link-config.json

pushd api-extractor-inputs-excelscript
../node_modules/.bin/api-extractor run
popd
Expand All @@ -35,7 +45,16 @@ pushd api-extractor-inputs-officescript
../node_modules/.bin/api-extractor run
popd

./node_modules/.bin/api-documenter yaml --input-folder ./json --output-folder ./yaml --office
pushd api-extractor-inputs-excelscript-release
../node_modules/.bin/api-extractor run
popd

pushd api-extractor-inputs-officescript-release
../node_modules/.bin/api-extractor run
popd

./node_modules/.bin/api-documenter yaml --input-folder ./json/json-preview --output-folder ./yaml/yaml-preview --office
./node_modules/.bin/api-documenter yaml --input-folder ./json/json-release --output-folder ./yaml/yaml-release --office

pushd scripts
node postprocessor.js
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "excelscript.d.ts",
"apiReport": {
"enabled": false
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "../json/json-release/<unscopedPackageName>.api.json"
},
"dtsRollup": {
"enabled": false
},
"messages": {
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-forgotten-export": {
"logLevel": "none"
}
},
"tsdocMessageReporting": {
"tsdoc-escape-right-brace": {
"logLevel": "none"
},
"tsdoc-escape-greater-than": {
"logLevel": "none"
},
"tsdoc-malformed-inline-tag": {
"logLevel": "none"
},
"tsdoc-unnecessary-backslash": {
"logLevel": "none"
}
}
}
}
Loading