1. Here's a thread that needs an answer: VBA macro for Inbox's attachments search
    Dismiss Notice

Categorize Outgoing Mail

Discussion in 'Outlook VBA and Custom Forms' started by akonn, Aug 4, 2017.

  1. akonn

    akonn

    New Member
    Hi,

    Using the macro in "ThisOutlookSession" to have my assign category box automatically open when sending new mail. But......It won't work when replying to mail. Any experts have a solution. Outlook 2016.


    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
     
  2. Diane Poremsky

    Diane Poremsky

    Senior Member
    you don't need the following line - ByVal Item As Object, Cancel As Boolean sets the item.
    Set Item = Application.ActiveInspector.CurrentItem

    i removed the set item line and it worked for both new and replies... but if it still fails, instead of Len(Item.Categories) = 0 , try item.categories =""

    also, note that when you set the category before sending, the category may visible to the recipient (if they use outlook) and in the message header: Keywords: Blue category.

    if you definitely don't want to share the categories with the recipients, you can either use an itemadd macro that watches the sent folder and brings up the dialog after its sent or see if Sending Categories on Email Messages works for you.
     
    Last edited: Aug 7, 2017
  3. akonn

    akonn

    New Member
    Thanks. Appears to be working now.
     
  4. Rusya27

    Rusya27

    New Member
    Thank Diane Poremsky, it's helped me too. I often had this problem. And now I can use it and all right.
     
Loading...

Share This Page