D
daniel123
I'm porting a Word COM Add-in that currently runs in Word 2003 / XP over to
Word 2007 B2TR. With some minor tweaking, the add-in runs OK in Word 2007
(with the exception of another weird bug that's not in scope here).
This add-in uses a C++ shim. I've been attempting to implement a custom
ribbon for this add-in, and have only been partially successful. I've gotten
the shim to implement the IRibbonExtensibility interface, and it calls into
the managed .NET (C#) code to retrieve the ribbon XML, and the ribbon is
displayed OK.
But I haven't been able to get a callback to work. I included a callback
method for a button on the COM shim (which would then call into the managed
..NET code to do whatever), but it seems like the callback never gets called.
The methods looks something like the following:
STDMETHOD(ButtonClicked)(Office::IRibbonControl *RibbonControl)
{
return m_pRibbon->MethodGoesHere(....);
}
and the ribbon xml looks something like the following:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="CustomTab" label="My Label">
<group id="SampleGroup" label="Sample Group">
<button id="Button" label="Click Here" size="large"
onAction="ButtonClicked" />
</group >
</tab>
</tabs>
</ribbon>
</customUI>
Note that I'm using Beta 2 Technical Refresh. (Also note that I'm on .NET
1.1, and want to maintain backward compatibility with Word 2003, which is why
I need to stick with the shim approach...)
Is there some other way to get ribbon callbacks to work with unmanaged C++?
Thanks!
Daniel
Word 2007 B2TR. With some minor tweaking, the add-in runs OK in Word 2007
(with the exception of another weird bug that's not in scope here).
This add-in uses a C++ shim. I've been attempting to implement a custom
ribbon for this add-in, and have only been partially successful. I've gotten
the shim to implement the IRibbonExtensibility interface, and it calls into
the managed .NET (C#) code to retrieve the ribbon XML, and the ribbon is
displayed OK.
But I haven't been able to get a callback to work. I included a callback
method for a button on the COM shim (which would then call into the managed
..NET code to do whatever), but it seems like the callback never gets called.
The methods looks something like the following:
STDMETHOD(ButtonClicked)(Office::IRibbonControl *RibbonControl)
{
return m_pRibbon->MethodGoesHere(....);
}
and the ribbon xml looks something like the following:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="CustomTab" label="My Label">
<group id="SampleGroup" label="Sample Group">
<button id="Button" label="Click Here" size="large"
onAction="ButtonClicked" />
</group >
</tab>
</tabs>
</ribbon>
</customUI>
Note that I'm using Beta 2 Technical Refresh. (Also note that I'm on .NET
1.1, and want to maintain backward compatibility with Word 2003, which is why
I need to stick with the shim approach...)
Is there some other way to get ribbon callbacks to work with unmanaged C++?
Thanks!
Daniel