none
Control 'Send' button in add-in RRS feed

  • Question

  • Hey , I want to know if I control somehow in the 'Send' button...

    For example if I want to add a special send button on my add-in and to simulate the click of the real send button ...

    Can I get the element of the 'Send'  button from the DOM of outlook ? is it possible?  when i try to get the document in my add-in I get just the Html page of my add-in and not all the full html . 

    Thanks All !

    Monday, October 31, 2016 11:12 AM

Answers

  • There is no way currently.

    [custom.development]

    • Marked as answer by ADD-IN123456 Wednesday, November 2, 2016 9:02 AM
    Tuesday, November 1, 2016 12:26 PM
  • Hi Add-in,

    I agree with Eugene, it is impossible under Office Add-ins which is developed by js and html.

    In my option, Office-ins is used to interop with data in Outlook, it is week for custom the Outlook UI. For custom send button, I think you need to develop with Office VSTO Add-ins which is developed by C#/VB.net. If this is a new feature you want in Office add-ins, I would suggest you submit a feedback.

    Best Regards,

    Edward


    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 ADD-IN123456 Wednesday, November 2, 2016 9:02 AM
    Wednesday, November 2, 2016 7:16 AM

All replies

  • Hello,

    The Outlook extensibility model doesn't provide anything for that. Possible ways to go are:

    1. Use a replacement form region for hiding the default UI. See Creating Outlook Form Regions for more information. 

    2. Use Windows API functions for subclassing the window and creating your own area or custom button. For example, see Creating Adjacent Windows In Outlook for more information. 

    3. Add a ribbon button for that. For example, VSTO provides the following ways for creating a custom UI:

    Walkthrough: Creating a Custom Tab by Using the Ribbon Designer

    Walkthrough: Creating a Custom Tab by Using Ribbon XML

    The Fluent UI (aka Ribbon UI) is described in depth in the following series of articles:

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)


    [custom.development]

    Monday, October 31, 2016 1:36 PM
  • Hey, 

    First thank you very much for your help !

    I read everything you write and everything looks pretty complicated  , and little bit old ...
    I just need to get the action of 'send' button .. My question if it's possible to get it and to disable/enable the click on the original 'send' button and take the action of the button to my own button that I will create on my add- in ?

    Everything I see in the links is to create a new button somewhere or to create a new Form but it's not help me to get the action or to disable the action of 'send' button .. it's not my purpose

    Hope you understand me  ...

    Thanks!!!




    Monday, October 31, 2016 2:14 PM
  • You can simply try to handle the ItemSend event of the Application class which is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item. It allows to cancel the default action. If the event procedure sets the Cancel argument to true, the send action is not completed and the inspector is left open.

    You can try to use the following VBA macro:

    Public WithEvents myOlApp As Outlook.Application  
     
     
    Public Sub Initialize_handler()  
     Set myOlApp = Outlook.Application  
    End Sub  
      
    Private Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)  
     Dim prompt As String  
     prompt = "Are you sure you want to send " & Item.Subject & "?"  
     If MsgBox(prompt, vbYesNo + vbQuestion, "Sample") = vbNo Then  
     Cancel = True  
     End If  
    End Sub

    So, you are free to cancel the default action and then do whatever you need. After you can submit an Outlook item anew by calling the Send method.


    [custom.development]

    Monday, October 31, 2016 11:29 PM
  • Hi Add-in,

    Based on your description, you are developing with Office add-ins which is developed by office.js and html, am I right? If so, you could not custom the built-in send button. For the Dom of your Office add-ins, you could only get your web page.

    If this is a new feature you want to include in the future, I would suggest you submit a feedback.

    http://officespdev.uservoice.com

    Best Regards,

    Edward


    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.

    Tuesday, November 1, 2016 5:17 AM
  • Thanks for both of you !

    I write my add-in in JavaScript using outlook add in api on the framework of Visual Studio 2015 . 

    link : dev.outlook.com/reference/add-ins

    (i write the link like this because it's not give me the option to put links here)

    Edward you right - I get the document of my add-in html page and not all the the current page that in the window... The question is if there is other way instead the Dom that I can get  access to button to get the click on 'send' somehow ?  Or maybe some way to get the document of all window and not just my html of my add in ? 

    Eugene Astdiev - you are great , thanks ! But i don't build my add in on VB or with the things you write.. Maybe there is a way to do what you say using my I build ? 

    This issue is really important  for me... So I must try all the option - I try to search for it in this forum and in the net but nothing useful for me yet.

    Thanks all again !!!!!




    Tuesday, November 1, 2016 9:26 AM
  • There is no way currently.

    [custom.development]

    • Marked as answer by ADD-IN123456 Wednesday, November 2, 2016 9:02 AM
    Tuesday, November 1, 2016 12:26 PM
  • Hi Add-in,

    I agree with Eugene, it is impossible under Office Add-ins which is developed by js and html.

    In my option, Office-ins is used to interop with data in Outlook, it is week for custom the Outlook UI. For custom send button, I think you need to develop with Office VSTO Add-ins which is developed by C#/VB.net. If this is a new feature you want in Office add-ins, I would suggest you submit a feedback.

    Best Regards,

    Edward


    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 ADD-IN123456 Wednesday, November 2, 2016 9:02 AM
    Wednesday, November 2, 2016 7:16 AM
  • Thank you very much . 

    How much it's similar what I done to develop with Office VSTO Add-ins  ?

    It's will be complicated to me to move my code to this option ? Is in this way also have a good api ?

    Wednesday, November 2, 2016 9:04 AM
  • Hi ADD-IN,

    For VSTO Add-ins, it only supported under Windows Desktop Office version. It did not supported in other platform like Outlook Web app. For detailed information, you could refer the first reply from Eugene.

    If you have any issues about Office VSTO Add-ins, I suggest you post your issue under below forum.

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

    For a simple Outlook VSTO add-ins, you could refer the link below:

    Walkthrough: Creating Your First VSTO Add-In for Outlook

    Best Regards,

    Edward


    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.

    Wednesday, November 2, 2016 9:20 AM