none
Custom Ribbon button in outlook 2010

    Question

  • Hi All,

    I have written a macro inside Outlook that I need to run

    How can I create a custom ribbon button in the home tab of Outlook 2010 using code that when I click on the button it will run my macro

    Macro name ReceiveStock

    |please help very urgent

    Thx


    CRM Manager

    Tuesday, January 15, 2013 12:18 AM

Answers

  • Is this a solution that you need to deploy to multiple users?  If so, you need to develop a COM Add-in; use the Outlook Add-in templates with Visual Studio and you can use the Ribbon wizard to easily create a custom button.

    Otherwise, I'm guessing you just need to map a button to a macro on your own computer.  In this case, open the Outlook Options dialog and click the Customize Ribbon page.  Select Macros from the "Choose commands from" dropdown, select your macro and add it to the desired Ribbon tab and group.


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Tuesday, January 15, 2013 4:35 PM
    Moderator
  • Code in Outlook COM addins can no longer call Outlook macro code, that unsupported feature was deprecated. Any code a COM addin should run should be contained in the addin.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "flashyjunior" <=?utf-8?B?Zmxhc2h5anVuaW9y?=> wrote in message news:cf1ee0ad-2af9-4e1a-a47f-19be7b211345...

    Hi All,

    I have tried the example and it works.

    But I only need a block of code in the button_click event instead of displaying a message box as in the example in the link you provided, it should call a macro in Outlook to run

    Thank You


    CRM Manager


    Ken Slovak MVP - Outlook
    Wednesday, January 16, 2013 3:10 PM
    Moderator
  • If you are developing and deploying a COM Add-in, there's no longer a need to use VBA macros. Migrate the code to the add-in.

    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Wednesday, January 16, 2013 3:27 PM
    Moderator

All replies

  • Is this a solution that you need to deploy to multiple users?  If so, you need to develop a COM Add-in; use the Outlook Add-in templates with Visual Studio and you can use the Ribbon wizard to easily create a custom button.

    Otherwise, I'm guessing you just need to map a button to a macro on your own computer.  In this case, open the Outlook Options dialog and click the Customize Ribbon page.  Select Macros from the "Choose commands from" dropdown, select your macro and add it to the desired Ribbon tab and group.


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Tuesday, January 15, 2013 4:35 PM
    Moderator
  • Hi Eric,

    Thx for the reply.

    Yes I need to deploy on multiple computers.

    Could you please explain further with your first suggestion.

    Thank

    Urgent please


    CRM Manager

    Tuesday, January 15, 2013 11:05 PM
  • If you've never built a COM add-in before, don't expect quick turn-around time learning this new technology - it can be tricky.  Best to start here:

    Outlook Solutions with Visual Studio | VSTO, Office | MSDN:
    http://msdn.microsoft.com/en-US/office/hh128768

    You can also use Add-in Express as a quicker way to build add-ins:

    http://www.add-in-express.com

    BTW, if your issue is urgent please contact Microsoft Support for fee-based services.


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Wednesday, January 16, 2013 12:24 AM
    Moderator
  • I agree with Eric in creating an Outlook Add for your solution

    you can refer to this link http://blogs.msdn.com/b/mcsuksoldev/archive/2010/10/01/building-and-deploying-an-outlook-2010-add-in-part-1-of-2.aspx

    Wednesday, January 16, 2013 5:41 AM
  • Hi All,

    I have tried the example and it works.

    But I only need a block of code in the button_click event instead of displaying a message box as in the example in the link you provided, it should call a macro in Outlook to run

    Thank You


    CRM Manager

    Wednesday, January 16, 2013 6:53 AM
  • Code in Outlook COM addins can no longer call Outlook macro code, that unsupported feature was deprecated. Any code a COM addin should run should be contained in the addin.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "flashyjunior" <=?utf-8?B?Zmxhc2h5anVuaW9y?=> wrote in message news:cf1ee0ad-2af9-4e1a-a47f-19be7b211345...

    Hi All,

    I have tried the example and it works.

    But I only need a block of code in the button_click event instead of displaying a message box as in the example in the link you provided, it should call a macro in Outlook to run

    Thank You


    CRM Manager


    Ken Slovak MVP - Outlook
    Wednesday, January 16, 2013 3:10 PM
    Moderator
  • If you are developing and deploying a COM Add-in, there's no longer a need to use VBA macros. Migrate the code to the add-in.

    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Wednesday, January 16, 2013 3:27 PM
    Moderator