Added a 'First Run' check, and some tweaks to Greg's Fluent (mostly to add back spaces that got dropped with posting)
Option Explicit
Private oRibbon As IRibbonUI
Sub Onload(ribbon As IRibbonUI)
'Create a ribbon instance for use in this project
Set oRibbon = ribbon
lbl_Exit:
Exit Sub
End Sub
Sub MyDDMacro(ByVal control As IRibbonControl, selectedID As String, _
selectedIndex As Integer)
MsgBox "What do you want to do with " & Choose(selectedIndex + 1, "Apples", "Bananas", "Kiwis", "Pears")
SaveSetting "Ribbon DD Demo", "Settings", "Index", CStr(selectedIndex)
lbl_Exit:
Exit Sub
End Sub
Sub GetSelectedItemIndex(ByVal control As IRibbonControl, ByRef index)
If Len(GetSetting("Ribbon DD Demo", "Settings", "Index")) = 0 Then
index = 0
Else
'This procedure is used to select the last selected index.
Select Case control.id
Case Is = "DD1"
index = CLng(GetSetting("Ribbon DD Demo", "Settings", "Index"))
Case Else
End Select
End If
lbl_Exit:
Exit Sub
End Sub
Capture.JPG
I couldn't get the XML to display correctly, so attaching my test docm