diff --git a/docs/docs-ref-autogen/excelscript/excelscript.cellcontrol.yml b/docs/docs-ref-autogen/excelscript/excelscript.cellcontrol.yml index e71f15c6..b47099f7 100644 --- a/docs/docs-ref-autogen/excelscript/excelscript.cellcontrol.yml +++ b/docs/docs-ref-autogen/excelscript/excelscript.cellcontrol.yml @@ -5,6 +5,10 @@ package: ExcelScript! fullName: ExcelScript.CellControl summary: Represents an interactable control inside of a cell. remarks: >- + + + + #### Used by @@ -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. @@ -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: |- diff --git a/docs/docs-ref-autogen/excelscript/excelscript.checkboxcellcontrol.yml b/docs/docs-ref-autogen/excelscript/excelscript.checkboxcellcontrol.yml index f05d0ea5..5df59bc3 100644 --- a/docs/docs-ref-autogen/excelscript/excelscript.checkboxcellcontrol.yml +++ b/docs/docs-ref-autogen/excelscript/excelscript.checkboxcellcontrol.yml @@ -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 diff --git a/docs/docs-ref-autogen/officescript.yml b/docs/docs-ref-autogen/officescript.yml index ff66022d..42972536 100644 --- a/docs/docs-ref-autogen/officescript.yml +++ b/docs/docs-ref-autogen/officescript.yml @@ -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! @@ -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! @@ -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! @@ -180,4 +230,26 @@ functions: type: 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] + }) + } + ``` diff --git a/docs/docs-ref-autogen/officescript/officescript.downloadfileproperties.yml b/docs/docs-ref-autogen/officescript/officescript.downloadfileproperties.yml index eb1a437d..1b06a876 100644 --- a/docs/docs-ref-autogen/officescript/officescript.downloadfileproperties.yml +++ b/docs/docs-ref-autogen/officescript/officescript.downloadfileproperties.yml @@ -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 diff --git a/docs/docs-ref-autogen/officescript/officescript.emailattachment.yml b/docs/docs-ref-autogen/officescript/officescript.emailattachment.yml index 0269aa24..16bcd150 100644 --- a/docs/docs-ref-autogen/officescript/officescript.emailattachment.yml +++ b/docs/docs-ref-autogen/officescript/officescript.emailattachment.yml @@ -9,6 +9,10 @@ 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 @@ -16,6 +20,30 @@ remarks: >- [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 diff --git a/generate-docs/API Coverage Report.csv b/generate-docs/API Coverage Report.csv index dca1ba19..657d3c1b 100644 --- a/generate-docs/API Coverage Report.csv +++ b/generate-docs/API Coverage Report.csv @@ -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 @@ -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 @@ -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 @@ -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 \ No newline at end of file +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 \ No newline at end of file