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

Can't execute Quit-Command

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





PostPosted: Mon Aug 18, 2003 12:12 am    Post subject: Can't execute Quit-Command Reply with quote

I am trying to call the following sub in a macro:

Code:
sub QuitWithoutSaving

   rem define variables
   dim document   as object
   dim dispatcher as object
   
   document   = ThisComponent.CurrentController.Frame
   dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
   dispatcher.executeDispatch(document, ".uno:Quit", "", 0, Array())

end sub


It is assigned to a botton in the function bar. As long as this sub is defined as under a module in the soffice-libraries it works fine. If it resides in a Module of a document library, it can't be executed anymore. I could execute other commands but not the Quit-command. Does anybody have an explanation or even a workaround for this?
Back to top
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Mon Aug 18, 2003 1:01 am    Post subject: Reply with quote

Work around...I will leave the explanation to someone else!
Code:
Sub Main
thiscomponent.close(false)
End Sub
Back to top
View user's profile Send private message
Guest
Guest





PostPosted: Mon Aug 18, 2003 1:11 am    Post subject: Reply with quote

Embarassed Thanks!
Back to top
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