none
Outlook 2007 Ribbon RRS feed

  • Question

  • Hi,

    For my one requirements, I want to add new control on an 'Appointment'. When I click on 'new' it is always opening 'Appointment' tab which is fine. Now I want to get idMso for 2nd tab i.e. 'Insert' where I want to add new Group for my requirement.

    Actually I would be great, if you help me out, to add new button under 'Insert' tab and Specific inside of 'Include' group.

    I searched a lot, however couldn't get any matching solution.

    Regards,

    Avinash

    Friday, November 4, 2011 10:21 AM

Answers

  • Hi Avinash,

    Thansk for your post.

    Ken is right that you can't custom buit-in group of ribbon. However, here is a workaround which you can take into a try. You can set the visible property of the built-in group to False and insert a custom group before the second built-in group, which is Tables group in this example, add the built-in control which is included in the built-in group in the order that control appears in buit-in group, and then add your custom control at the end of the group. See the XML code:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <ribbon>
        <tabs>
          <tab idMso="TabInsert">
            <group idMso ="GroupInclude" visible ="false"/>
            <group id="MyGroup" label="Include" insertBeforeMso="GroupInsertTables">
              <button idMso ="AttachFile" size ="large"/>
              <button idMso ="AttachItem" size ="large"/>
              <menu idMso ="BusinessCardInsertMenu" size="large"/>         
              <menu idMso ="SignatureInsertMenu" size ="large"/>
              
              <button id ="button1" label ="myButton" size="large" imageMso ="HappyFace" onAction ="button1_click"/>
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>
    

    This workaround makes your custom control looks like appear in the buit-in group.

    In addition, if you want the customization only apply to appointment ribbon, you would have to do something with the GetCustomUI method:

        public string GetCustomUI(string ribbonID)
            {
                switch (ribbonID)
                {
                    case "Microsoft.Outlook.Appointment":
                        return GetResourceText("OAAppointmentRibbon.Ribbon1.xml");
                    default :
                        return string.Empty;           
                }          
            }
    

    I hope this helps.


    Best Regards, Calvin Gao [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.

    • Marked as answer by Avikenjale Monday, November 7, 2011 8:24 AM
    Monday, November 7, 2011 3:08 AM
    Moderator

All replies

  • Logically enough, the tab idMso is "TabInsert".
     
    You cannot add your own control to an built-in group in that tab. You'd have to add your own group and add your button to your custom group.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "Akenjale" <=?utf-8?B?QWtlbmphbGU=?=> wrote in message news:bbdc8ffb-74e0-420a-89bd-5e11b75729ab...

    Hi,

    For my one requirements, I want to add new control on an 'Appointment'. When I click on 'new' it is always opening 'Appointment' tab which is fine. Now I want to get idMso for 2nd tab i.e. 'Insert' where I want to add new Group for my requirement.

    Actually I would be great, if you help me out, to add new button under 'Insert' tab and Specific inside of 'Include' group.

    I searched a lot, however couldn't get any matching solution.

    Regards,

    Avinash


    Ken Slovak MVP - Outlook
    Friday, November 4, 2011 1:25 PM
  • Hi Avinash,

    Thansk for your post.

    Ken is right that you can't custom buit-in group of ribbon. However, here is a workaround which you can take into a try. You can set the visible property of the built-in group to False and insert a custom group before the second built-in group, which is Tables group in this example, add the built-in control which is included in the built-in group in the order that control appears in buit-in group, and then add your custom control at the end of the group. See the XML code:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <ribbon>
        <tabs>
          <tab idMso="TabInsert">
            <group idMso ="GroupInclude" visible ="false"/>
            <group id="MyGroup" label="Include" insertBeforeMso="GroupInsertTables">
              <button idMso ="AttachFile" size ="large"/>
              <button idMso ="AttachItem" size ="large"/>
              <menu idMso ="BusinessCardInsertMenu" size="large"/>         
              <menu idMso ="SignatureInsertMenu" size ="large"/>
              
              <button id ="button1" label ="myButton" size="large" imageMso ="HappyFace" onAction ="button1_click"/>
            </group>
          </tab>
        </tabs>
      </ribbon>
    </customUI>
    

    This workaround makes your custom control looks like appear in the buit-in group.

    In addition, if you want the customization only apply to appointment ribbon, you would have to do something with the GetCustomUI method:

        public string GetCustomUI(string ribbonID)
            {
                switch (ribbonID)
                {
                    case "Microsoft.Outlook.Appointment":
                        return GetResourceText("OAAppointmentRibbon.Ribbon1.xml");
                    default :
                        return string.Empty;           
                }          
            }
    

    I hope this helps.


    Best Regards, Calvin Gao [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.

    • Marked as answer by Avikenjale Monday, November 7, 2011 8:24 AM
    Monday, November 7, 2011 3:08 AM
    Moderator
  • Thank you for answering my query.

    Don't mind if I do ask new few questions:

    1. I am trying to add some image on 'Menu' control under group (without ImageMso) I am unable to do it.

    2. The functionality like Signature click I would like to implement on Buttons which are lying under Menu control, how can I do it? i.e. inserting some text specific to button in Appointment body.

     

    Monday, November 7, 2011 8:30 AM
  • I got answer for point#2. Now only searching for point#1. Image.
    Monday, November 7, 2011 10:19 AM