Question : Customizing MS Word 2007 RibbonX - ComboBox OnChange doesn't fire

I'm creating a custom Ribbon menu for MS Word 2007.  I have some working buttons that open specific documents.  I'm having trouble with a ComboBox, however.

For the Buttons, I'm using "OnAction" and for the ComboBox, "OnChange".

The buttons work fine.  The ComboBox does nothing and I can't figure out why.

Here is the Ribbon.xml:


http://schemas.microsoft.com/office/2006/01/customui">
 
   
     
     
       
         

Answer : Customizing MS Word 2007 RibbonX - ComboBox OnChange doesn't fire

I discovered what the problem was.

<comboBox id="ComboBox1" label="Department Memos" onChange="OnChange1" supertip="Select your Department to open the Memo Template">
            <item id="item1" label="Executive" />
            <item id="item2" label="Fiscal" />
            <item id="item3" label="Human Resources" />
</comboBox>

The ComboBox control returns only the text of the selected item; whatever is in label="..text..", not the index number of the selection.  

So I changed:

Public Sub OnChange1(ByVal IRibbonControl As Object)
        applicationObject.Documents.Add("S:\Marketing\MSMENU\memo.doc")
End Sub

to:

Sub OnChange1(ByVal control As IRibbonControl, ByVal text As String)
        applicationObject.Documents.Add("http://WebServer../../Marketing/MSMENU/memos/" & text & ".doc")
End Sub

...and made all the labels identical to the filenames.  The ComboBox works now.
Random Solutions  
 
programming4us programming4us