Close Development Tools Window

How do I close the Development Tools window if open. The Code below seems to toggle the window; so if closed it opens it, and if open it closes it. When I run the macro I just need the window closed regardless.

Sub CloseDevelopmentWindow
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "DevelopmentToolsDockingWindow"
args1(0).Value = false

dispatcher.executeDispatch(document, ".uno:DevelopmentToolsDockingWindow", "", 0, args1())

end sub

you can try to find your way up and get the flag saying the window is open or not …

maybe some dev would have a shortcut …

Development - The Document Foundation Wiki

You can check if the Developer Tools window is open using the method described here.
You need to run the macro from the document (not from BasicIDE).

1 Like

The “DevelopmentToolsDockingWindow” doesn’t display and “State”
Using the TestFeature code you mention.

However, it does work for the “ViewDataSourceBrowser”

Any ideas on how to tackle the “DevelopmentToolsDockingWindow” issue?

Did you taken the following into account?

Sorry I have only used LibreOffice for 5 days, so I do not understand when you say run from document. Are you referring to assigning the macro via the Tools> Customise > Events, which is what I have done under Open Document

Actually I think it is working, i.e. When the document ii opening the window is closed, but when I run the macro within BASIC it doesn’t work. I assume that is what you are referring to. Sorry for the confusion on my side.

To test the macro: from Calc’s menu, choose ToolsMacrosRun Macro, and select the TestFeature macro.

Yes that worked. Thank you