none
Initializing Ribbon DropDown with a value (like a ComboBox)

    Question

  • I have a DropDown in Word Ribbon that I would like to set with an initial value (like the GetText Callback for a ComboBox...which is working fine for a ComboBox that I also have).

    I'm able to set my ComboBox, editBoxes, and even my toggleButtons based on initial information, but I can't get the DropDowns to setup correctly.

    Any help would be greatly appreciated.

    Paul Goldstein


    Paul D. Goldstein Forceware Systems, Inc.

    Wednesday, December 12, 2012 6:07 PM

Answers

  • Have you tried the "GetSelectedItemIndex" callback?

    Sub GetSelectedItemIndex(ByVal control As IRibbonControl, ByRef Index)
    Select Case control.id
      Case Is = "DD1"
        Index = 0
      Case Else
    End Select
    End Sub


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm

    Thursday, December 13, 2012 2:33 AM

All replies

  • Have you tried the "GetSelectedItemIndex" callback?

    Sub GetSelectedItemIndex(ByVal control As IRibbonControl, ByRef Index)
    Select Case control.id
      Case Is = "DD1"
        Index = 0
      Case Else
    End Select
    End Sub


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm

    Thursday, December 13, 2012 2:33 AM
  • Hi Greg,

        Thanks for writing. I had tried the GetSelectedItemIndex at first but was initially unsuccessful. That's because I was returning the value of the "label" field instead of the "id" field (the label field just had a prefix on it). Once I figured that out, it worked just fine.

        Thanks again.

        Paul Goldstein


    Paul D. Goldstein Forceware Systems, Inc.

    Thursday, December 13, 2012 5:22 PM