incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 119365] .uno:Quit strangely shows the file-open dialog.
Date Thu, 17 May 2012 16:48:23 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=119365

--- Comment #4 from Ariel Constenla-Haile <arielch@apache.org> ---
Created attachment 77559
  --> https://issues.apache.org/ooo/attachment.cgi?id=77559&action=edit
Form with a Macro assigned to "Close" button

In the control properties:

- Tab "General", set "Action" to "None"
- Tab "Events" - "Execute action" asign the following macro, previously saved
inside the document:

REM  *****  BASIC  *****

Private Const CLOSE_CMD = ".uno:CloseDoc"
Private Const QUIT_CMD = ".uno:Quit"

Sub ExecDispatch(oEvent as Object)
On Error Resume Next
Dim oDispatchProvider as Object
oDispatchProvider = ThisComponent.getCurrentController().getFrame()

Dim oDispatchHelper as Object
'http://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/DispatchHelper.html
'http://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/XDispatchHelper.html
oDispatchHelper = CreateUnoService("com.sun.star.frame.DispatchHelper")

oDispatchHelper.executeDispatch(oDispatchProvider,_
CLOSE_CMD,_
"_self",_
com.sun.star.frame.FrameSearchFlag.ALL,_
Array())
End Sub

Replace CLOSE_CMD with QUIT_CMD if you really want to QUIT the application
instead of CLOSING the current document.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message