OfficeScript.DownloadFileProperties interface

ダウンロードするファイル。

注釈

使用元

/**
 * 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]
    })    
}

プロパティ

content

ファイルの内容。

name

ダウンロードされたファイルの名前。 ファイル拡張子によってファイルの種類が決まります。 サポートされている拡張子は ".txt" と ".pdf" です。 既定値は ".txt" です。

プロパティの詳細

content

ファイルの内容。

content: string;

プロパティ値

string

name

ダウンロードされたファイルの名前。 ファイル拡張子によってファイルの種類が決まります。 サポートされている拡張子は ".txt" と ".pdf" です。 既定値は ".txt" です。

name: string;

プロパティ値

string