none
XML/VB custom Ribbon - getlabel problem RRS feed

  • Question

  • I just posted this question in the "Outlook for Developers", and just realized that it is more relevent to post it here :

     

    I'm using VSTO2010 to add a button on a outlook 2010 ribbon using XML and VB.net

    With a standard label on my button everything is OK, the button appears and the click works.

    Then I want to manage label dynamically using getlabe - in this situation my custom group/button won't appear no more.

    XML (Ribbon.XML):

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
        <ribbon startFromScratch="false">
            <tabs>
                <tab idMso="TabAddIns">
                    <group id="Group1" label="mongroupe">
                        <button id="Button1" getlabel="getlabel" onAction="Button1_Click" showImage="false" />
                    </group>
                </tab>
            </tabs>
        </ribbon>
    </customUI>

     

    VB (from callback region in Ribbon class ) :

    ...    Public Sub getlabel(ByVal control As Office.IRibbonControl, ByRef returnval As String)
            returnval = "MY_BUTTON"
        End Sub

    ...

     

    Hope this is clear enough, Thanks for your help

    Friday, August 19, 2011 1:54 PM

Answers

  • If you copy/pasted the xml into your post right from your code, then the problem might be that the command is "getLabel" not "getlabel" and change your callback to this:

      Public Function getlabel(ByVal control As Office.IRibbonControl) As String
        Return "MY_BUTTON"
      End Function
    

     


    Kind Regards, Rich ... http://greatcirclelearning.com
    Friday, August 19, 2011 4:05 PM

All replies

  • If you copy/pasted the xml into your post right from your code, then the problem might be that the command is "getLabel" not "getlabel" and change your callback to this:

      Public Function getlabel(ByVal control As Office.IRibbonControl) As String
        Return "MY_BUTTON"
      End Function
    

     


    Kind Regards, Rich ... http://greatcirclelearning.com
    Friday, August 19, 2011 4:05 PM
  • That worked !!!!

    1) getLabel instead of getlabel

    I can't believe that I wasted so much time just because of that - After that my button appears, but with no label

    2) function instead of Sub

    Now everything is just fine

    Thank you so much.

    Monday, August 22, 2011 6:52 AM