none
VSTO Outlook 2010 Attachments Tab RRS feed

  • Question

  • Hi, I'm trying to add my custom ribbon to attachments tab which is displayed when you click on attachment in the incoming message window. But it does not appear.
    I've tried to set ControlIdType to custom and then Position to AfterOfficeId GroupAttachmentMessage
    i also tried to set ControlIdType to TabAttachments but it still does not appear.
    I'm wondering is there any way to add my ribbon to attachments tab
    May be the problem is that TabAttachments is a "Tool Tabs" tab type?
    Thanks!

    Wednesday, May 25, 2011 9:27 AM

All replies

  • Hi,

    I tried to add the Ribbon for the TabAttachments using the Ribbon Visual Designer, and I faced this:

     

    So then I used the Ribbon XML, and it worked:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <ribbon startFromScratch="false">
        <contextualTabs>
          <tabSet idMso="TabSetAttachments">
            <tab idMso="TabAttachments">
              <group id="GroupMyActions">
                <button id="ButtonMyAction" label="Check Attachments" />
              </group>
            </tab>
          </tabSet>
        </contextualTabs>
      </ribbon>
    </customUI>
    

    Result:

     

    So, it works with the Ribbon XML. If you can export the current Ribbon (Visual Designer) to XML, it would be great.

     

    Regards,

    Mauro


    twitter.com/mcastagnasso | castagnasso.wordpress.com | If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Thursday, May 26, 2011 3:14 AM
  • Thanks, Mauro! It works, but still...i can't export Ribbon to XML.

    Is there any way to add ribbon to TabAttachments with visual designer ?

    Thursday, May 26, 2011 1:31 PM
  • Hi Nikita,

    In my understanding, the contextual tabs customization is a feature since VSTO + Office 2010, when contextualTabs, contextMenu and commands elements of the customUI root element where introduced.

    http://msdn.microsoft.com/en-us/library/ee692172.aspx#OfficeOLExtendingUI_ContextualTabs

    Regards,

    Mauro


    twitter.com/mcastagnasso | castagnasso.wordpress.com | If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Thursday, May 26, 2011 2:23 PM
  • Hi Nikita,

    Did you solve the issue?

    Regards,

    Mauro


    twitter.com/mcastagnasso | castagnasso.wordpress.com | If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Wednesday, June 1, 2011 2:41 AM
  • Hi Mauro!

    no i have not. The link you gave me contains exmaples using xml, my project architecture does not allow to use Ribbon xml. I have to find the way to add my ribbon created in designer to attachments tab. I want to stress that i can't export it to xml.

    Thanks, Nikita.

    Wednesday, June 1, 2011 6:33 AM
  • Hi Nikita,

    Yes, I understood your point, but maybe you find the way outside this forum.

    Regards,

    Mauro


    twitter.com/mcastagnasso | castagnasso.wordpress.com | If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Wednesday, June 1, 2011 12:28 PM
  • Hi Nikita,

     

    Thanks for posting in the MSDN Forum.

     

    If you review the .cs file which generate via Visual Studio, you will find that the RibbonTab instance is an internal reference. It means that we aren’t able to invoke them form our project.

     

    However, I found a reference to access the Ribbon via VBA on Project. I’m not sure whether it can work for Outlook, but it worth to test.

     

    Have a good day,

     

    Tom

     

    Reference:

    How to: Use VBA to Add a Custom Command to the Ribbon: http://msdn.microsoft.com/en-us/library/ee767705.aspx


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, June 3, 2011 3:38 AM
    Moderator