P
Peter Karlström
Hi
In one of our VBA-projects we have customized a ribbon tab with the Office
2007 Custom UI Editor. The resulting xml-code shows below:
+++Start Code+++
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="MyAddInInitialize">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Custom Tab">
<group id="customGroup" label="Protokoll">
<box id="box1" boxStyle="vertical">
<dropDown id="DropDown1" label="Format"
onAction="ThisDocument.FMFormat" >
<item id="DropdownList1" label="Normal"/>
<item id="DropdownList2" label="Heading 1" />
<item id="DropdownList3" label="Heading 2"/>
<item id="DropdownList4" label="Heading 3" />
</dropDown>
<dropDown id="DropDown2" label="Specialformat"
onAction="ThisDocument.FMInfo">
<item id="ListDropdown1" label="Meeting list" />
<item id="ListDropdown2" label="Notes" />
<item id="ListDropdown3" label="Notes descision" />
<item id="ListDropdown4" label="Notes reviewer" />
</dropDown>
<button id="customButton2" label="Insert heading" size="normal"
onAction="ThisDocument.InfogaNyPunkt" />
<button id="customButton3" label="Change/Show properties"
size="normal" onAction="ThisDocument.VisaDialog" />
</box>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
+++ End code+++
In a macro-enabled document template we have made all functions avialable
and everything works fine, if it was not for the behaviour of the dropdown
lists.
If the user makes a choice from the list, the code executes just fine but
the selected item remains selected. We have looked everywhere to find a way
to "reset" the dropdown list to its original value, but we have found nothing.
The ribbon is made public with the following line:
Public MyRibbon As IRibbonUI
In the initialization of the Addin the MyRibbon is set with the following
line:
Set MyRibbon = Ribbon
When the user uses the dropdown list the following proc take action:
Public Sub FMFormat(control As IRibbonControl, selectedID As String,
selectedIndex As Integer)
We have tried the following:
MyRibbon.InvalidateControl (control.ID) does not seems to work.
MyRibbon.Invalidate does not seem to work either.
MyRibbon.Refresh method found in some hints is not valid.
What can we do about this? Anybody?
Thanks in advance
In one of our VBA-projects we have customized a ribbon tab with the Office
2007 Custom UI Editor. The resulting xml-code shows below:
+++Start Code+++
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="MyAddInInitialize">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Custom Tab">
<group id="customGroup" label="Protokoll">
<box id="box1" boxStyle="vertical">
<dropDown id="DropDown1" label="Format"
onAction="ThisDocument.FMFormat" >
<item id="DropdownList1" label="Normal"/>
<item id="DropdownList2" label="Heading 1" />
<item id="DropdownList3" label="Heading 2"/>
<item id="DropdownList4" label="Heading 3" />
</dropDown>
<dropDown id="DropDown2" label="Specialformat"
onAction="ThisDocument.FMInfo">
<item id="ListDropdown1" label="Meeting list" />
<item id="ListDropdown2" label="Notes" />
<item id="ListDropdown3" label="Notes descision" />
<item id="ListDropdown4" label="Notes reviewer" />
</dropDown>
<button id="customButton2" label="Insert heading" size="normal"
onAction="ThisDocument.InfogaNyPunkt" />
<button id="customButton3" label="Change/Show properties"
size="normal" onAction="ThisDocument.VisaDialog" />
</box>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
+++ End code+++
In a macro-enabled document template we have made all functions avialable
and everything works fine, if it was not for the behaviour of the dropdown
lists.
If the user makes a choice from the list, the code executes just fine but
the selected item remains selected. We have looked everywhere to find a way
to "reset" the dropdown list to its original value, but we have found nothing.
The ribbon is made public with the following line:
Public MyRibbon As IRibbonUI
In the initialization of the Addin the MyRibbon is set with the following
line:
Set MyRibbon = Ribbon
When the user uses the dropdown list the following proc take action:
Public Sub FMFormat(control As IRibbonControl, selectedID As String,
selectedIndex As Integer)
We have tried the following:
MyRibbon.InvalidateControl (control.ID) does not seems to work.
MyRibbon.Invalidate does not seem to work either.
MyRibbon.Refresh method found in some hints is not valid.
What can we do about this? Anybody?
Thanks in advance