2

Good morning, my company is looking for a solution in order to distribute an add-in for Outlook 2013 that add a button in the ribbon. I want to create an add-in for Outlook 2013 and I saw that is possible using Visual Studio (I use VS 2013 or 2010) but I don't understand how to add a button in the ribbon (in particular in Home section) and execute a macro when I click on the button (the macro is already created). I read this tutorial https://msdn.microsoft.com/en-us/library/cc668191.aspx and this worked. Someone can help me with some piece of code(c#)? Thanks for your help

Simone
  • 95
  • 1
  • 7
  • Hi Simone, were you actually able to add a button to the Home tab? I am trying to use VB, but I'm still not seeing how to add a button to an existing tab (ribbon) rather than the Add-In ribbon. – darktrek Sep 24 '15 at 18:21

1 Answers1

3

VSTO provides two main ways for customizing the Ribbon UI:

  1. Using the Ribbon designer. See Walkthrough: Creating a Custom Tab by Using the Ribbon Designer for more information.

  2. Using the Ribbon XML markup. See Walkthrough: Creating a Custom Tab by Using Ribbon XML for more information.

You need to specify the idMso attribute of the built-in tab if you need to add your custom controls there. See Office 2013 Help Files: Office Fluent User Interface Control Identifiers for control IDs.

Finally, I'd suggest moving your VBA macro to the add-in. It will improve the overall performance and allows to use the BCL classes (a wide varioety of controls and components) for getting the job done. Moveover, you will be able to deplay the add-in easily. VBA macros are not designed for deployiong on multiple PCs.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Thanks for your help Eugene. How can I move the macro in the add-In and the assign the macro to the button? – Simone Aug 06 '15 at 11:49
  • And after that I create my VSTO project, how can I use it to distribute as add-in? – Simone Aug 06 '15 at 14:09
  • 1
    See [Deploying an Office Solution](https://msdn.microsoft.com/en-us/library/bb386179.aspx) for more information. – Eugene Astafiev Aug 06 '15 at 16:51
  • Thanks Eugene!!! Now I create my add-in. I'd like that when I click a button on the ribbon I can reply the email and display it. With the macro I can use the reply method. Do you know how to do using c#? – Simone Aug 07 '15 at 07:19
  • 1
    I'd suggest asking separate questions in new threads. So, other users may easily find the answer. – Eugene Astafiev Aug 07 '15 at 08:55
  • Eugene, how does the Ribbon XML interact with the identifier for the Home tab? I think the identifier is TabMail for the 'Home' tab. Correct me if I'm wrong. – darktrek Sep 23 '15 at 21:11
  • 1
    Ah! The idMso you refer to is an XML attribute of the 'tab' tag. Sorry, I didn't make the connection. I'll leave my above comment in case anyone else is confused. – darktrek Oct 01 '15 at 21:48