BigBen500 Newbie

Joined: 17 Sep 2009 Posts: 1
|
Posted: Sun Sep 20, 2009 10:56 pm Post subject: Accessing toolbar buttons |
|
|
Hi,
my problem is about accessing the buttons of my own created toolbar. It is a toolbar which i have intalled per extension (with Addons.xcu) in OpenOffice (e.g Writer).
Its now my task to deactivate a button of this toolbar at runtime. Therefore i have to access this toolbaritem.
I ca access successfully all of the standard toolbars of OO with the following code (im using VB 6).
| Code: | Dim sToolbarURL As String
sToolbarURL = "private:resource/toolbar/standardbar"
Dim oSupplier As Object
Set oSupplier = CreateUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")
Dim oModuleCfgMgr As Object
Set oModuleCfgMgr = oSupplier.getUIConfigurationManager("com.sun.star.text.TextDocument")
Dim oToolbarSettings As Object
Set oToolbarSettings = oModuleCfgMgr.getSettings(sToolbarURL, True) |
I can work with the oToolbarSettings object and edit the toolbar buttons. Now i want to access my own addon toolbar, so i changed the ressource URL to
| Code: | | private:resource/toolbar/addon_TestMacroLib.OfficeToolBar |
After that, the line
| Code: | | Set oToolbarSettings = oModuleCfgMgr.getSettings(sToolbarURL, True) |
throws a "NoSuchElementException"
The ressource URL is correct, with the LayoutManager class i can access my toolbar, but not edit the buttons.
So my questions are: Where is my addon toolbar? How can i access this toolbar to edit e.g the buttons visibility. Is there another collection for addon toolbars?
I appreciate your help in advance. |
|