Hello,
I created a custom toolbar inside Writer and now I have to hide or display some items, depending on a condition inside my macro.
I found a snipped that helps me list the different toolbars, here it is :
Dim oDoc, oFrame
Dim oCfgManager
Dim oToolInfo
Dim x
Dim s$
Dim iToolType as Integer
oDoc = ThisComponent
REM This is the integer value three.
iToolType = com.sun.star.ui.UIElementType.TOOLBAR
oFrame = oDoc.getCurrentController().getFrame()
oCfgManager = oDoc.getUIConfigurationManager()
oToolInfo = oCfgManager.getUIElementsInfo( iToolType )
For Each x in oFrame.LayoutManager.getElements()
s = s & x.ResourceURL & CHR$(10)
If x.ResourceURL = "private:resource/toolbar/custom_toolbar_50c37ac9" Then
' I'd like to display the items inside this toolbar...
End If
Next
MsgBox s, 0, "Toolbars in Component"
Could you please tell me how I can get the items that are inside this toolbar ?
Once the items are listed, I will then be able to display or hide the items.
Thanks for your help.