新的 Outlook 邮件项目忘记类别

New Outlook Mail Item forgetting Categories

我有以下代码,但创建的电子邮件没有设置任何类别。曾经.

        Private Sub Application_Reminder(ByVal Item As Object)
            .
            .
            .
            Dim objMail As Outlook.mailItem
            Set objMail = Application.CreateItem(olMailItem)
            With objMail
                .BodyFormat = olFormatHTML
                .To = toContent
                .CC = ccContent
                .HTMLBody = messageContent
                .Categories = Item.Categories
                .Subject = Item.Subject
                .Send
            End With
            .
            .
            .
        End Sub

Item 对象是一个设置了提醒的任务对象。我将提醒放在 Application_Reminder 子中并从中生成一封电子邮件。所有属性都从任务复制到电子邮件。在 运行 时,我可以在 .Send 上设置一个断点,然后看到电子邮件的 .Categories 属性 设置正确。收到电子邮件时,该电子邮件已重置且为空白。我使用的类别是标准的 Outlook 类别。

为避免在外发电子邮件中泄露潜在的隐私信息,当您使用 Exchange 服务器邮箱时,类别不会随 Outlook 中的电子邮件一起发送。当您使用带有内部代码或可能令人尴尬的关键字的类别时,收件人将看不到它们。

在发送邮件时,类别是由 Exchange Server 的传输规则而不是 Outlook 删除的。您可以查看放置在 Sent Items 文件夹中的项目。

如果您需要在外发电子邮件中发送类别,您可以使用 SendPersonalCategories 注册表项。

HKEY_CURRENT_USER\Software\Microsoft\Office.0\Outlook\Preferences

DWORD: SendPersonalCategories

Value Data: 1 to keep categories on sent mail, 0 to not include categories

其中 16.0 代表 Outlook 版本 (2016)。

Sending Categories on Email Messages 文章中阅读更多相关信息。