Hi,
I’m quite new in LibreOffice basic scripting and running on redHAT Linux 9.3, have to detect&report any opened Help window (for security purposes).
There are some examples that are supposed to detect the opened Help window, but I failed to run them properly:
1. Sub CheckHelpWindow()
Dim oDesktop As Object
Dim oHelpWindow As Object
' Get the current desktop - *fails for .getScriptContext()*
oDesktop = ThisComponent.getScriptProvider().getScriptContext().getDesktop()
' Check if the help window is active
oHelpWindow = oDesktop.getCurrentFrame().getContainerWindow()
If oHelpWindow.isVisible() Then
MsgBox "Help window is active."
Else
MsgBox "Help window is not active."
End If
End Sub
2. Sub CheckHelpActive()
dim oActiveHelp as object
' Fails to getActiveSheet() - not found.
oActiveHelp = ThisComponent.getCurrentController().getActiveSheet()
rem msgBox(oActiveHelp)
If Application.IsHelpActive Then
MsgBox "Help is active."
Else
MsgBox "Help is not active."
End If
End Sub
Where am I wrong, and is there a proper way to perform the requested operation ?
Thanks
Zeev