none
Add a custom control INSIDE Inspector New Mail form RRS feed

  • Question

  • Hi everyone!

    I develop an Outlook COM AddIn and I want to show additional information inside New Mail window for users and to display a certain state of my AddIn.

    Is it possible to add any custom controls INSIDE the Inspector New Mail form, for example, between Subject and mail text field?  Also, is there a way to put any controls that interact with my COM AddIn?

    Best regards,

    Alex


    • Edited by Qobalt Monday, May 13, 2019 12:45 PM
    Monday, May 13, 2019 12:32 PM

Answers

  • Then your only other option is using raw Windows API to insert your window: https://code.msdn.microsoft.com/OlAdjacentWindows/

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


    Monday, May 13, 2019 5:03 PM
  • Right, but both of them will be outside of the mail composer. I'd like to have the ability to add more controls, for example, between Subject field and mail body field. Is it possible?

    Well, there is nothing in the Outlook object model that supports what you want to do.  So you would use Win32 API calls to find the relevant HWNDs (unsupported implementation detail), resize as necessary and create your own controls that Outlook wouldn't know about.  And that's just the beginning.  IMHO, It seems like a fragile and error-prone exercise.  Is it possible?  Maybe, but I haven't tried to do it.
    • Marked as answer by Qobalt Wednesday, May 15, 2019 1:08 PM
    Monday, May 13, 2019 5:07 PM

All replies

  • Sure, you can add a top-aligned form region or a a task pane that will host your custom controls.

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

    Monday, May 13, 2019 3:24 PM
  • Right, but both of them will be outside of the mail composer. I'd like to have the ability to add more controls, e.g, between Subject field and mail body field.

    For example, I can edit the Inspector form using New Mail->Developer->Design this form feature in Outlook. I can add, let's say, a label and a button right next to a Subject field. But is it possible to do this programmatically? And to tie up the addin logic to the elements?

    • Edited by Qobalt Monday, May 13, 2019 5:02 PM
    Monday, May 13, 2019 4:54 PM
  • Then your only other option is using raw Windows API to insert your window: https://code.msdn.microsoft.com/OlAdjacentWindows/

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


    Monday, May 13, 2019 5:03 PM
  • Right, but both of them will be outside of the mail composer. I'd like to have the ability to add more controls, for example, between Subject field and mail body field. Is it possible?

    Well, there is nothing in the Outlook object model that supports what you want to do.  So you would use Win32 API calls to find the relevant HWNDs (unsupported implementation detail), resize as necessary and create your own controls that Outlook wouldn't know about.  And that's just the beginning.  IMHO, It seems like a fragile and error-prone exercise.  Is it possible?  Maybe, but I haven't tried to do it.
    • Marked as answer by Qobalt Wednesday, May 15, 2019 1:08 PM
    Monday, May 13, 2019 5:07 PM
  • This question was asked for COM AddIn. Is this answer also applied for VSTO project? Or is there any more capability we can do in VSTO project to add controls inside Inspector in between Subject and Mail Body section, and tie up the logic to it?

    Monday, May 27, 2019 7:10 AM
  • VSTO addin *is* a COM addin. VSTO is just a framework to make COM addin development easier.

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

    Monday, May 27, 2019 8:45 PM