none
Accessing Report Items for Emails using VBA RRS feed

  • Question

  • Hi All

    I have had some great help from this forum in order to enable me to generate report metrics on individual mailboxes.  Now I want to go one step further by accessing ReportItems but I cant seem to find a starting point.  For example I want to be able to report the date and time that an email was assigned a Category.  Would someone give me some guidance to get me started.

    Many thanks in anticipation.

    Kind regards

    Tony


    TKHussar

    Tuesday, January 19, 2016 9:38 AM

Answers

  • the time a mail was assigned a Category

    You can handle the PropertyChange event which is fired when an explicit built-in property (for example, Subject) of the object is changed.

    or a mail was moved to a different folder.

    The ItemRemove event of the Items class is fired when an item is deleted from the specified collection.

    • Marked as answer by David_JunFeng Sunday, January 31, 2016 2:42 PM
    Tuesday, January 19, 2016 10:29 AM
  • What Eugene is suggesting is that you need to write a COM addin which tracks the user selecting messages (Explorer.SelectionChange) and opening messages (Inspectors.NewInspector) to install event handlers on these items. Once MailItem.PropertyChange event fires, you can check the name of the property passed as the parameter. If it is "Categories", you can act appropriately.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by David_JunFeng Monday, February 1, 2016 1:37 AM
    Tuesday, January 19, 2016 5:45 PM
  • Hello Tony,

    You may find the Developing an Inspector Wrapper for Outlook 2010 article helpful .

    • Marked as answer by David_JunFeng Sunday, January 31, 2016 2:43 PM
    Tuesday, January 19, 2016 7:23 PM

All replies

  • Hello TK,

    Unlike other Microsoft Outlook objects, you cannot create the ReportItem object. Report items are created automatically when any report or error in general is received from the mail transport system. You need to use a mail item object if you want to send reports.

    Tuesday, January 19, 2016 9:50 AM
  • Hi Eugene

    Many thanks for the prompt response.  basically what I am looking for is to find out what time an email was actioned.  For example the time a mail was assigned a Category, or a mail was moved to a different folder or what time a mail was read.  Is this possible?

    Hope this makes my request clearer.

    Kind regards

    Tony


    TKHussar



    • Edited by TKHussar Tuesday, January 19, 2016 10:26 AM
    Tuesday, January 19, 2016 10:22 AM
  • the time a mail was assigned a Category

    You can handle the PropertyChange event which is fired when an explicit built-in property (for example, Subject) of the object is changed.

    or a mail was moved to a different folder.

    The ItemRemove event of the Items class is fired when an item is deleted from the specified collection.

    • Marked as answer by David_JunFeng Sunday, January 31, 2016 2:42 PM
    Tuesday, January 19, 2016 10:29 AM
  • Thanks Eugene, I will see if I can work that one out and give it a go.

    Tony


    TKHussar

    Tuesday, January 19, 2016 10:59 AM
  • Hi Eugene

    I am totally stuck.  Tried to look for sample of how I can use the PropertyChange item, for example, the time a category was changed for each email in a particular folder and export to Excel but have failed miserably.

    I have code that exports a number of fields to Excel but cant work out how to export this information also for each email.

    Can you help please?

    Tony


    TKHussar

    Tuesday, January 19, 2016 11:20 AM
  • What Eugene is suggesting is that you need to write a COM addin which tracks the user selecting messages (Explorer.SelectionChange) and opening messages (Inspectors.NewInspector) to install event handlers on these items. Once MailItem.PropertyChange event fires, you can check the name of the property passed as the parameter. If it is "Categories", you can act appropriately.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by David_JunFeng Monday, February 1, 2016 1:37 AM
    Tuesday, January 19, 2016 5:45 PM
  • Hello Tony,

    You may find the Developing an Inspector Wrapper for Outlook 2010 article helpful .

    • Marked as answer by David_JunFeng Sunday, January 31, 2016 2:43 PM
    Tuesday, January 19, 2016 7:23 PM