PDA

View Full Version : [SOLVED:] Categorize Outgoing Mail - Macro



akonn
08-04-2017, 06:55 AM
Hi,

trying to have the categorize menu pop up when sending mail. I current have it working when it is new mail, but creates an error when I reply to a mail. I current have the code below in "ThisOutlookSession".

Outlook 2016 - 32-bit


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If TypeOf Item Is Outlook.MailItem And Len(Item.Categories) = 0 Then
Set Item = Application.ActiveInspector.CurrentItem
Item.ShowCategoriesDialog
End If
End Sub

Anyone have a fix for this?

Thanks.

skatonni
08-04-2017, 11:40 AM
You pass Item with ByVal Item As Object. You are to use that item.


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If TypeOf Item Is Outlook.mailitem And Len(Item.Categories) = 0 Then
Item.ShowCategoriesDialog
End If
End Sub

akonn
08-07-2017, 12:26 AM
Thanks, appears to be working now once I deleted the extra line.