OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Accessing toolbar buttons

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
BigBen500
Newbie
Newbie


Joined: 17 Sep 2009
Posts: 1

PostPosted: Sun Sep 20, 2009 10:56 pm    Post subject: Accessing toolbar buttons Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group