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
38 changes: 38 additions & 0 deletions docs/docs-ref-autogen/excelscript/excelscript.cellcontrol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ package: ExcelScript!
fullName: ExcelScript.CellControl
summary: Represents an interactable control inside of a cell.
remarks: >-




#### Used by


Expand All @@ -14,6 +18,7 @@ remarks: >-
[setControl](/javascript/api/office-scripts/excelscript/excelscript.range#excelscript-excelscript-range-setcontrol-member(1))



Learn more about the types in this type alias through the following links.


Expand All @@ -22,6 +27,39 @@ remarks: >-
[ExcelScript.MixedCellControl](/javascript/api/office-scripts/excelscript/excelscript.mixedcellcontrol),
[ExcelScript.CheckboxCellControl](/javascript/api/office-scripts/excelscript/excelscript.checkboxcellcontrol)


#### Examples


```TypeScript

/**
* This script creates a task list and displays the completion values as checkboxes.
*/
function main(workbook: ExcelScript.Workbook) {
const sheet = workbook.addWorksheet();
const taskRange = sheet.getRange("A1:B4");

// Add tasks and their completion values.
taskRange.setValues([
["Task", "Complete"],
["Review data", true],
["Update chart", false],
["Send report", false]
]);

// Display the Boolean values in the Complete column as checkboxes.
const checkboxRange = sheet.getRange("B2:B4");
const checkboxControl: ExcelScript.CellControl = {
type: ExcelScript.CellControlType.checkbox
};
checkboxRange.setControl(checkboxControl);

taskRange.getFormat().autofitColumns();
}

```

isPreview: false
isDeprecated: false
syntax: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,37 @@ fullName: ExcelScript.CheckboxCellControl
summary: >-
Represents a checkbox. This is a cell control that allows a user to toggle the
boolean value in a cell.
remarks: ''
remarks: |-


#### Examples

```TypeScript
/**
* This script creates a task list and displays the completion values as checkboxes.
*/
function main(workbook: ExcelScript.Workbook) {
const sheet = workbook.addWorksheet();
const taskRange = sheet.getRange("A1:B4");

// Add tasks and their completion values.
taskRange.setValues([
["Task", "Complete"],
["Review data", true],
["Update chart", false],
["Send report", false]
]);

// Display the Boolean values in the Complete column as checkboxes.
const checkboxRange = sheet.getRange("B2:B4");
const checkboxControl: ExcelScript.CellControl = {
type: ExcelScript.CellControlType.checkbox
};
checkboxRange.setControl(checkboxControl);

taskRange.getFormat().autofitColumns();
}
```

isPreview: false
isDeprecated: false
Expand Down
80 changes: 76 additions & 4 deletions docs/docs-ref-autogen/officescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,32 @@ functions:
uid="OfficeScript!OfficeScript.DownloadFileProperties:interface" />
return:
type: void
description: ''
description: |-


#### Examples

```TypeScript
/**
* This script saves a worksheet as a PDF and emails that PDF to a recipient.
*/
function main(workbook: ExcelScript.Workbook) {
// Create the PDF.
const pdfObject = OfficeScript.convertToPdf();
const pdfFile = { name: "report.pdf", content: pdfObject }; // Enter your desired PDF name here.

// Download the PDF.
OfficeScript.downloadFile(pdfFile);

// Email the PDF.
OfficeScript.sendMail({
to: "name@email.com", // Enter your recipient email address here.
subject: "[Demo] Monthly Sales Report", // This is the subject of your email.
content: "Here's the Monthly Sales Report", // This is the content within your email.
attachments: [pdfFile]
})
}
```
- name: OfficeScript.Metadata.getScriptName()
uid: OfficeScript!OfficeScript.Metadata.getScriptName:function(1)
package: OfficeScript!
Expand All @@ -114,7 +139,20 @@ functions:
content: 'export function getScriptName(): string;'
return:
type: string
description: ''
description: |-


#### Examples

```TypeScript
/**
* This script gets the name of the current script and prints it to the console.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the name of the currently running script.
const scriptName = OfficeScript.Metadata.getScriptName();
console.log("The currently running script is: " + scriptName);
```
- name: OfficeScript.saveCopyAs(filename)
uid: OfficeScript!OfficeScript.saveCopyAs:function(1)
package: OfficeScript!
Expand Down Expand Up @@ -161,7 +199,19 @@ functions:
type: string
return:
type: void
description: ''
description: |-


#### Examples

```TypeScript
/**
* This script saves a copy of the current workbook to the user's OneDrive.
*/
function main(workbook: ExcelScript.Workbook) {
OfficeScript.saveCopyAs("CopyOfBook2.xlsx");
}
```
- name: OfficeScript.sendMail(mailProperties)
uid: OfficeScript!OfficeScript.sendMail:function(1)
package: OfficeScript!
Expand All @@ -180,4 +230,26 @@ functions:
type: <xref uid="OfficeScript!OfficeScript.MailProperties:interface" />
return:
type: void
description: ''
description: |-


#### Examples

```TypeScript
/**
* This script saves a worksheet as a PDF and emails that PDF to a recipient.
*/
function main(workbook: ExcelScript.Workbook) {
// Create the PDF.
const pdfObject = OfficeScript.convertToPdf();
const pdfFile = { name: "report.pdf", content: pdfObject }; // Enter your desired PDF name here.

// Email the PDF.
OfficeScript.sendMail({
to: "name@email.com", // Enter your recipient email address here.
subject: "[Demo] Monthly Sales Report", // This is the subject of your email.
content: "Here's the Monthly Sales Report", // This is the content within your email.
attachments: [pdfFile]
})
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,43 @@ package: OfficeScript!
fullName: OfficeScript.DownloadFileProperties
summary: The file to download.
remarks: >-




#### Used by


- [OfficeScript](/javascript/api/office-scripts/officescript):
[downloadFile](/javascript/api/office-scripts/officescript#officescript-officescript-downloadfile-function(1))

#### Examples


```TypeScript

/**
* This script saves a worksheet as a PDF and emails that PDF to a recipient.
*/
function main(workbook: ExcelScript.Workbook) {
// Create the PDF.
const pdfObject = OfficeScript.convertToPdf();
const pdfFile: OfficeScript.DownloadFileProperties = { name: "report.pdf", content: pdfObject }; // Enter your desired PDF name here.

// Download the PDF.
OfficeScript.downloadFile(pdfFile);

// Email the PDF.
OfficeScript.sendMail({
to: "name@email.com", // Enter your recipient email address here.
subject: "[Demo] Monthly Sales Report", // This is the subject of your email.
content: "Here's the Monthly Sales Report", // This is the content within your email.
attachments: [pdfFile]
})
}

```

isPreview: false
isDeprecated: false
type: interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,41 @@ summary: >-
specified, the following error is shown: "The message has no recipient. Please
enter a value for at least one of the "to", "cc", or "bcc" parameters."
remarks: >-




#### Used by


-
[OfficeScript.MailProperties](/javascript/api/office-scripts/officescript/officescript.mailproperties):
[attachments](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-attachments-member)

#### Examples


```TypeScript

/**
* This script saves a worksheet as a PDF and emails that PDF to a recipient.
*/
function main(workbook: ExcelScript.Workbook) {
// Create the PDF.
const pdfObject = OfficeScript.convertToPdf();
const pdfFile = { name: "report.pdf", content: pdfObject }; // Enter your desired PDF name here.

// Email the PDF.
OfficeScript.sendMail({
to: "name@email.com", // Enter your recipient email address here.
subject: "[Demo] Monthly Sales Report", // This is the subject of your email.
content: "Here's the Monthly Sales Report", // This is the content within your email.
attachments: [pdfFile]
})
}

```

isPreview: false
isDeprecated: false
type: interface
Expand Down
16 changes: 8 additions & 8 deletions generate-docs/API Coverage Report.csv
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ ExcelScript,ExcelScript.CalculationType,N/A,Enum,Missing,true
ExcelScript,ExcelScript.CalculationType,"full",EnumField,Great,false
ExcelScript,ExcelScript.CalculationType,"fullRebuild",EnumField,Excellent,false
ExcelScript,ExcelScript.CalculationType,"recalculate",EnumField,Excellent,false
ExcelScript,ExcelScript.CellControl,N/A,TypeAlias,Good,false
ExcelScript,ExcelScript.CellControl,N/A,TypeAlias,Good,true
ExcelScript,ExcelScript.CellControlType,N/A,Enum,Good,false
ExcelScript,ExcelScript.CellControlType,"checkbox",EnumField,Good,false
ExcelScript,ExcelScript.CellControlType,"empty",EnumField,Good,false
Expand Down Expand Up @@ -1079,7 +1079,7 @@ ExcelScript,ExcelScript.ChartType,"xyscatterSmoothNoMarkers",EnumField,Missing,f
ExcelScript,ExcelScript.ChartUnderlineStyle,N/A,Enum,Missing,false
ExcelScript,ExcelScript.ChartUnderlineStyle,"none",EnumField,Missing,false
ExcelScript,ExcelScript.ChartUnderlineStyle,"single",EnumField,Missing,false
ExcelScript,ExcelScript.CheckboxCellControl,N/A,Interface,Good,false
ExcelScript,ExcelScript.CheckboxCellControl,N/A,Interface,Good,true
ExcelScript,ExcelScript.CheckboxCellControl,"type",Property,Missing,false
ExcelScript,ExcelScript.ClearApplyTo,N/A,Enum,Missing,true
ExcelScript,ExcelScript.ClearApplyTo,"all",EnumField,Good,false
Expand Down Expand Up @@ -3423,10 +3423,10 @@ ExcelScript,ExcelScript.WorksheetSearchCriteria,N/A,Interface,Fine,true
ExcelScript,ExcelScript.WorksheetSearchCriteria,"completeMatch",Property,Excellent,false
ExcelScript,ExcelScript.WorksheetSearchCriteria,"matchCase",Property,Excellent,false
ExcelScript,N/A,N/A,Package,Missing,false
OfficeScript,OfficeScript.DownloadFileProperties,N/A,Interface,Poor,false
OfficeScript,OfficeScript.DownloadFileProperties,N/A,Interface,Poor,true
OfficeScript,OfficeScript.DownloadFileProperties,"content",Property,Good,false
OfficeScript,OfficeScript.DownloadFileProperties,"name",Property,Excellent,false
OfficeScript,OfficeScript.EmailAttachment,N/A,Interface,Excellent,false
OfficeScript,OfficeScript.EmailAttachment,N/A,Interface,Excellent,true
OfficeScript,OfficeScript.EmailAttachment,"content",Property,Good,false
OfficeScript,OfficeScript.EmailAttachment,"name",Property,Excellent,false
OfficeScript,OfficeScript.EmailContentType,N/A,Enum,Good,false
Expand All @@ -3447,7 +3447,7 @@ OfficeScript,OfficeScript.MailProperties,"subject",Property,Good,false
OfficeScript,OfficeScript.MailProperties,"to",Property,Great,false
OfficeScript,N/A,N/A,Package,Missing,false
OfficeScript,N/A,"OfficeScript.convertToPdf()",Method,Good,true
OfficeScript,N/A,"OfficeScript.downloadFile(fileProperties)",Method,Fine,false
OfficeScript,N/A,"OfficeScript.Metadata.getScriptName()",Method,Fine,false
OfficeScript,N/A,"OfficeScript.saveCopyAs(filename)",Method,Great,false
OfficeScript,N/A,"OfficeScript.sendMail(mailProperties)",Method,Good,false
OfficeScript,N/A,"OfficeScript.downloadFile(fileProperties)",Method,Fine,true
OfficeScript,N/A,"OfficeScript.Metadata.getScriptName()",Method,Fine,true
OfficeScript,N/A,"OfficeScript.saveCopyAs(filename)",Method,Great,true
OfficeScript,N/A,"OfficeScript.sendMail(mailProperties)",Method,Good,true