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