OfficeScript.EmailAttachment interface

メールと共に送信する添付ファイル。 to cc、または bcc パラメーターの少なくとも 1 つに対して値を指定する必要があります。 受信者が指定されていない場合は、次のエラーが表示されます。"メッセージに受信者がいません。 "to"、"cc"、または "bcc" パラメーターのうち少なくとも 1 つの値を入力してください。

注釈

使用元

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

プロパティ

content

ファイルの内容。

name

添付ファイルを表すアイコンの下に表示されるテキスト。 この文字列はファイル名と一致する必要はありません。

プロパティの詳細

content

ファイルの内容。

content: string;

プロパティ値

string

name

添付ファイルを表すアイコンの下に表示されるテキスト。 この文字列はファイル名と一致する必要はありません。

name: string;

プロパティ値

string