locked
Outlook Add-in VSTO Deployment, backspace, delete keys don't work in a webBrowser control of outlook addin RRS feed

  • Question

  • Im actually developing an outlook add-in, where i have an Usercontrol(added to CustomTaskPane) form with webbrowser control, through which i navigate t an url, basically an html page. I have a textBox in the html page, strange the backspace, delete, Ctrl-C, Ctrl-V keys dont seem to work(gets eaten away). If i try to run the html page independently, keys work fine. But when through the outlook addin, the keys get chewed up. How do i fix this??

    Any response would be of great help

    • Moved by William Zhou CHN Friday, July 15, 2011 6:00 AM (From:Outlook IT Pro Discussions)
    Wednesday, July 13, 2011 2:12 PM

Answers

  • The only way would be to use low level Win32 API message hooks. You'd need to intercept messages sent to the hWnd of Outlook and when your custom task pane was the current window you'd have to redirect the messages to the CTP window.
     
    That's something I'd prefer not to do myself using managed code unless I really, really had to. There's just too much opportunity to completely blow up Outlook or Windows itself. If you decide to risk it you can search on global message hooks for c# or VB.NET, whichever you're using.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Ana Thomas" <=?utf-8?B?QW5hIFRob21hcw==?=> wrote in message news:c24eaf61-35fc-42ac-be26-8903d4e2096e...

    Im actually developing an outlook add-in, where i have an Usercontrol(added to CustomTaskPane) form with webbrowser control, through which i navigate t an url, basically an html page. I have a textBox in the html page, strange the backspace, delete, Ctrl-C, Ctrl-V keys dont seem to work(gets eaten away). If i try to run the html page independently, keys work fine. But when through the outlook addin, the keys get chewed up. How do i fix this??

    Any response would be of great help


    Ken Slovak MVP - Outlook
    • Proposed as answer by Calvin_Gao Wednesday, July 20, 2011 7:11 AM
    • Marked as answer by Calvin_Gao Friday, July 22, 2011 12:24 PM
    Friday, July 15, 2011 6:16 PM

All replies

  • The only way would be to use low level Win32 API message hooks. You'd need to intercept messages sent to the hWnd of Outlook and when your custom task pane was the current window you'd have to redirect the messages to the CTP window.
     
    That's something I'd prefer not to do myself using managed code unless I really, really had to. There's just too much opportunity to completely blow up Outlook or Windows itself. If you decide to risk it you can search on global message hooks for c# or VB.NET, whichever you're using.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Ana Thomas" <=?utf-8?B?QW5hIFRob21hcw==?=> wrote in message news:c24eaf61-35fc-42ac-be26-8903d4e2096e...

    Im actually developing an outlook add-in, where i have an Usercontrol(added to CustomTaskPane) form with webbrowser control, through which i navigate t an url, basically an html page. I have a textBox in the html page, strange the backspace, delete, Ctrl-C, Ctrl-V keys dont seem to work(gets eaten away). If i try to run the html page independently, keys work fine. But when through the outlook addin, the keys get chewed up. How do i fix this??

    Any response would be of great help


    Ken Slovak MVP - Outlook
    • Proposed as answer by Calvin_Gao Wednesday, July 20, 2011 7:11 AM
    • Marked as answer by Calvin_Gao Friday, July 22, 2011 12:24 PM
    Friday, July 15, 2011 6:16 PM
  • This is NOT the only way and certainly not the best. https://stackoverflow.com/a/17725108 has a much better and easier answer.
    Tuesday, July 18, 2017 9:19 PM