none
New email notification and mailbox scan on Outlook Add in using JavaScript API for Office RRS feed

  • Question

  • Hi!

    I was given a task to create an extension module for Outlook using the JavaScript API for Office. What I neeed to do is:

    1) Scan for emails in the mailbox for new emails, on start up and when add in installed for the first time.

    2) With new emails found on 1), plus on new email notification, use an external api to classify the email based on email address.

    Are the things above possible? I mean, the ability to scan onver the mail box, and to react to new emails by using a notificatino mechanism?

    I have checked documentation and looks like JavaScript APi for Office only works on individual items.

    Any help would be much appreciated, thank you!

    --Eliot

    Tuesday, March 14, 2017 7:01 AM

Answers

  • Hello,

    >>I have checked documentation and looks like JavaScript APi for Office only works on individual items.

    Yes. Office JS API works for an individual item. If you want to get item collection, you could use Outlook Mail REST API reference:

    Get messages

    You can get a message collection or an individual message from a mailbox folder.

    If you have any issues about Outlook REST API, please post on the following forum:

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=Office365forDevelopers

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by sergio_eliot Thursday, March 16, 2017 11:27 PM
    Wednesday, March 15, 2017 1:59 AM
    Moderator

All replies

  • Hello,

    >>I have checked documentation and looks like JavaScript APi for Office only works on individual items.

    Yes. Office JS API works for an individual item. If you want to get item collection, you could use Outlook Mail REST API reference:

    Get messages

    You can get a message collection or an individual message from a mailbox folder.

    If you have any issues about Outlook REST API, please post on the following forum:

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=Office365forDevelopers

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by sergio_eliot Thursday, March 16, 2017 11:27 PM
    Wednesday, March 15, 2017 1:59 AM
    Moderator
  • Thank you Celeste for your valuable answer.

    How about events to which a JavaScript API for Office enabled API can react to?

    As far as I've read on documentation, this events are handled:

    Office.initialize, events on selection changes at the document level, data and select changes on link levels, and changes on settings.

    is there any chance that we can use application wide events, such as a event to when a new email arrives at the mailbox, or to be notify on the change on the size of the application's window?

    On the task I was required, I would need this kind of events.

    I would aprreciate any further help you can provide.

    Thank you, best regards!

    --Eliot


    • Edited by sergio_eliot Thursday, March 16, 2017 12:23 AM corrected misspelled word
    Wednesday, March 15, 2017 10:46 PM
  • Hi Eliot,

    Unfortunately, Office JS API doesn't provide any events to use when new mails arrive or changing the size of application windows.I suggest you submit a feedback on Office Dev User Voice site: https://officespdev.uservoice.com/

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 16, 2017 10:24 AM
    Moderator