none
Create a button that opens a URL in outlook 2010 Using VSTO addin RRS feed

  • Question

  • Hi,

    I was trying to follow the below article and I'm able to create a button called group 1 in outlook but when I click on it nothing happens. Could someone advise please?


    https://social.msdn.microsoft.com/Forums/office/en-US/ba1a77cf-8e91-4148-93cb-1418f3ad7141/add-a-button-that-opens-a-url-in-the-home-tab-ribbon?forum=outlookdev 


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Office.Tools.Ribbon;
    
    namespace OutlookAddIn2
    {
        public partial class Ribbon1
        {
            private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
            {
    
            }
    
            private void btnReferrals_Click(object sender, RibbonControlEventArgs e)
            {
                string myURL = "http://www.msdn.com";
                System.Diagnostics.Process.Start(myURL);
            }
        }
    }


    Please remember to mark the replies as answers if they help.











    Monday, October 31, 2016 8:00 PM

Answers

  • Hi,

    According to your screenshot and description, you add a group instead of a button, so the click doesn’t work.

    To make a button work, first you need to add a button. Drag the Button control into the group1 In Ribbon.cs[Design], then double click the button to view code. 

    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.

    Tuesday, November 1, 2016 5:40 AM
    Moderator

All replies

  • Hello Praveen,

    I don't see any button in the group shown on the screenshot. What ribbon XML markup did you use for creating a custom UI?

    Did you try to debug the code? What custom button do you click to get the callback invoked?


    [custom.development]

    Monday, October 31, 2016 11:15 PM
  • Hi Eugene,

    Thank you for your reply. I'm glad you responded.

    I'm using Ribbon Visual Designer. I'm fairly new to VSTO addin and C#.  This is my First add in.

    I made the following changes.

    tab1 Microsoft.Office.Tools.Ribbon.RibbonTab controlid to Tabmail and Position to BeforeoffieId Find

    and Ribbon type to Microsoft.outlook.explorer

    group1 Microsoft.Office.Tools.Ribbon.Ribbongroup Position to BeforeoffieId Find

    In the screenshot you will see something called group1 that is the one i created. If I click on group1 in outlook nothing happens. No controls are added. I wanted to open an URL using this button. 

    Thank you for your help!!



    Please remember to mark the replies as answers if they help.



    Tuesday, November 1, 2016 12:05 AM
  • Hi,

    According to your screenshot and description, you add a group instead of a button, so the click doesn’t work.

    To make a button work, first you need to add a button. Drag the Button control into the group1 In Ribbon.cs[Design], then double click the button to view code. 

    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.

    Tuesday, November 1, 2016 5:40 AM
    Moderator
  • Hi Celeste,

    You made my day. That is what I was looking for. Thank you very much.


    Please remember to mark the replies as answers if they help.

    Tuesday, November 1, 2016 3:30 PM