CaptainFuzzyFace
CaptainFuzzyFace

Reputation: 339

New Outlook Mail Item forgetting Categories

I have the following code but the email that is created doesn't have any categories set. Ever.

        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

The Item object is a Task object that has a reminder set. I'm trapping the reminder in the Application_Reminder sub and generating an email from it. All properties get copied from the task to the email. At run time I can but a breakpoint on .Send and see that the .Categories property of the email is set correctly. When the email is received, that has been reset and is blank. The categories that I'm using are the standard Outlook ones.

Upvotes: 0

Views: 154

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49397

To avoid releasing potentially private information on outgoing email messages, categories are not sent with email in Outlook when you use Exchange server mailboxes. When you use categories with internal codes or potentially embarrassing keywords, the recipient will not see them.

The Category is removed by Exchange Server's transport rules, not Outlook, when the message is sent. You may check out the item placed to the Sent Items folder.

If you need to send categories on outgoing email you can use the SendPersonalCategories registry entry.

HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Preferences

DWORD: SendPersonalCategories

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

Where 16.0 stands for the Outlook version (2016).

Read more about that in the Sending Categories on Email Messages article.

Upvotes: 2

Related Questions