This project has moved and is read-only. For the latest updates, please go here.

Ribbon - trouble setting control values programmatically

Aug 13, 2013 at 10:39 AM
Edited Aug 13, 2013 at 11:13 AM
I'm experiencing some difficulties with customising the ribbon with NetOffice (SharpDevelop). For example, when I try to declare a Label Control as follows:

<labelControl id=""lblFirstName"" getLabel=""getLabel""></labelControl>"

and then add the following procedure:
Sub getLabel(control As Office.IRibbonControl, ByRef label)
    Select Case control.ID
        Case "lblFirstName"
            label = "set to something else"
    End Select
End Sub
Then SharpDevelop wouldn't let me compile, because label in getLabel has not been assigned a type - although this would be ok in VBA. When I add a type to label, like ByRef label as Object, then Office, Outlook 2007 in my case, complains because the CallBack-Signatures do not match.

Can someone give me a pointer here what I'm missing?
Aug 13, 2013 at 10:56 AM
Edited Aug 13, 2013 at 11:13 AM
ups, that was some kind of a really basic misunderstanding: getLabel is of course not a Sub, but a Function, returning the desired value for the label:

...
<labelControl id=""lblFirstName"" getLabel=""getLabel""></labelControl>"
...
Function getLabel(control As Office.IRibbonControl)
    Select Case control.ID
        Case "lblFirstName"
            return "Beispiellabel"
  
End Function
does the trick