Share via


Office.MailboxEnums.MoveSpamItemTo enum

注意

この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。

報告されたスパムまたはフィッシング メッセージがスパムレポート アドインによって処理された後に移動されるフォルダーを指定します。

統合スパムレポート機能の詳細については、「統合 スパム レポート アドインの実装 (プレビュー)」を参照してください。

注釈

[ API セット: メールボックス プレビュー ]

適用される Outlook モード: メッセージの読み取り

重要: この列挙型は、event.completed メソッドの moveItemTo プロパティに値を割り当てるためにのみ使用できます。 プロパティのみをサポートする Outlook on Windows バージョンの場合は、別の postProcessingAction 文字列値を割り当てる必要があります。 サポートされている文字列値の一覧については、「 Office.SpamReportingEventCompletedOptions.postProcessingAction」を参照してください。

// The following example handles a SpamReporting event to process a reported spam or phishing message.
function onSpamReport(event) {
    // Get the Base64-encoded EML format of a reported message.
    Office.context.mailbox.item.getAsFileAsync({ asyncContext: event }, (asyncResult) => {
        if (asyncResult.status === Office.AsyncResultStatus.Failed) {
            console.log(`Error encountered during message processing: ${asyncResult.error.message}`);
            return;
        }

        // Run additional processing operations here.

        /**
         * Signal that the spam-reporting event has completed processing.
         * It then moves the reported message to a custom mailbox folder named "Reported Messages"
         * and shows a post-processing dialog to the user.
         * If an error occurs while the message is being processed, the `onErrorDeleteItem`
         * property determines whether the message will be deleted.
         */
        const event = asyncResult.asyncContext;
        event.completed({
            moveItemTo: Office.MailboxEnums.MoveSpamItemTo.CustomFolder,
            folderName: "Reported Messages",
            onErrorDeleteItem: true,
            showPostProcessingDialog: {
                title: "Contoso Spam Reporting",
                description: "Thank you for reporting this message.",
            },
        });
    });
}

フィールド

CustomFolder = "customFolder"

報告されたメッセージがメールボックス内のカスタム フォルダーに移動されることを指定します。

DeletedItemsFolder = "deletedItemsFolder"

報告されたメッセージがメールボックスの [削除済みアイテム] フォルダーに移動されることを指定します。

JunkFolder = "junkFolder"

報告されたメッセージがメールボックスの迷惑メール Email フォルダーに移動されることを指定します。

NoMove = "noMove"

報告されたメッセージがメールボックス内の現在のフォルダーに残ることを指定します。