Public Ruban As IRibbonUI
Public blnRadio(1 To 2) As Boolean
'Callback for customUI.onLoad
Sub objRuban(ribbon As IRibbonUI)
Set Ruban = ribbon
blnRadio(1) = True
Ruban.InvalidateControl "Button1"
End Sub
'Callback for Button1 getImage
Sub Button1_getImage(control As IRibbonControl, ByRef returnedVal)
If blnRadio(1) Then
returnedVal = "ActiveXRadioButton"
Else
returnedVal = "ShapeDonut"
End If
End Sub
'Callback for Button2 getImage
Sub Button2_getImage(control As IRibbonControl, ByRef returnedVal)
If blnRadio(2) Then
returnedVal = "ActiveXRadioButton"
Else
returnedVal = "ShapeDonut"
End If
End Sub
'Callback for Button1 onAction
Sub Button1_onAction(control As IRibbonControl)
blnRadio(1) = True
blnRadio(2) = False
Ruban.InvalidateControl "Button1"
Ruban.InvalidateControl "Button2"
'--- code de traitement ---
End Sub
'Callback for Button2 onAction
Sub Button2_onAction(control As IRibbonControl)
blnRadio(1) = False
blnRadio(2) = True
Ruban.InvalidateControl "Button1"
Ruban.InvalidateControl "Button2"
'--- code de traitement ---
End Sub