Nachtinho Nachtigall
Posts: 5
Joined: 2024-05-03
|
Hi,
I have a ribbon in an add-in that should be focused after loading. This works in the 'AddinModule_AddinStartupComplete' event when I use ActivateRibbonTab(adxRibbonTab1.Id).
However, if I do not activate the add-in at the start of Word but manually activate it through COM Add-Ins, the focus is not set.
Why does this not happen, and can I use another event to make it work in this case as well?
Kind regards,
Guido |
|
Andrei Smolin
Add-in Express team
Posts: 18965
Joined: 2006-05-11
|
Hello Guido,
An Add-in Express based COM add-in implements several COM interfaces. Two of them are: IDTExtensibility2 - I'll call it the add-in interface, and IRibbonExtensibility - the Ribbon interface. When the add-in loads, the methods these interfaces provide are called. The order in which the two interfaces are invoked depends on many things outside of your code. Accordingly, you should not expect that the Ribbon interface was already called - to prepare the Ribbon UI - when a method of the add-in interface (AddinStartupComplete) is called.
Try to call ActivateRibbonTab() in the OnRibbonLoaded event of the add-in module. If this doesn't work either, start a 1-second timer in OnRibbonLoaded; in the timer event call ActivateRibbonTab().
Regards from Poland (GMT+2),
Andrei Smolin
Add-in Express Team Leader |
|