none
How to monitor user's input when he/she is writing a new email? [VS2013, C#] RRS feed

  • Question

  • I posted this question in Outlook forum and someone recommended me to turn to this forum for help.


    I'm writing a Outlook add-in which should read the user's input and recommend the next input on the fly. For example, I wrote "I'm a" and the add-in should give me some recommendation about the next input, like "Manager | Developer | ...".

    I don't know how to monitor the user's input as he/she composing the email. The MailItem in Outlook Object Model seems not provide an event like "OnBodyChanged". Any suggestions?

    Shall I use hook? Does Outlook have a message loop that I can modify?

    Monday, June 30, 2014 2:41 AM

Answers

  • Hello,

    As I already wrote to you in the original forum thread, the Word object model (nor Outlook) doesn't provide the required events for implementing the described functionality. I.e. there is no trivial way. You are free to use Windows API functions and intercept the keyboard input.

    Monday, June 30, 2014 8:42 AM
  • Hi MoonLio

    Eugene pretty much sums up the situation. There is no functionality in-place in the Office applications that support what you describe.

    Besides keyboard hooks, the only other suggestion I can make is that the user compose his email messages in an .NET application you create and that you generate the email and transfer into it what the user writes.


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, June 30, 2014 3:10 PM
    Moderator

All replies

  • Hello,

    As I already wrote to you in the original forum thread, the Word object model (nor Outlook) doesn't provide the required events for implementing the described functionality. I.e. there is no trivial way. You are free to use Windows API functions and intercept the keyboard input.

    Monday, June 30, 2014 8:42 AM
  • Hi MoonLio

    Eugene pretty much sums up the situation. There is no functionality in-place in the Office applications that support what you describe.

    Besides keyboard hooks, the only other suggestion I can make is that the user compose his email messages in an .NET application you create and that you generate the email and transfer into it what the user writes.


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, June 30, 2014 3:10 PM
    Moderator