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

Intercept 'Save' Upon 'Close'

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


Joined: 14 Sep 2007
Posts: 12

PostPosted: Wed Oct 10, 2007 12:18 pm    Post subject: Intercept 'Save' Upon 'Close' Reply with quote

I've created a Basic macro to replace 'Save' and 'SaveAs' items in the 'File' menu, but now need to intercept the 'Save' that occurs upon document 'Close' if it has been modified.
How do I?

Thanks.
Back to top
View user's profile Send private message
talmai
General User
General User


Joined: 11 Jul 2008
Posts: 10
Location: Salvador/BA - Brasil

PostPosted: Tue Jul 15, 2008 6:24 pm    Post subject: Reply with quote

try this: http://www.oooforum.org/forum/viewtopic.phtml?t=16224&highlight=save+saveas

but use: aURL.Complete.compareToAscii(".uno:Close")
_________________
www.talmai.com.br
Back to top
View user's profile Send private message
DVezina
OOo Advocate
OOo Advocate


Joined: 29 Sep 2006
Posts: 248
Location: Orlando

PostPosted: Wed Jul 16, 2008 11:36 am    Post subject: Reply with quote

This code checks if the document has been modified. If so, I store data and then run my own Save macro (merckSave) before closing.


Code:


   oDoc = ThisComponent
   If (oDoc.isModified) Then
        If (oDoc.hasLocation AND (Not oDoc.isReadOnly)) Then
          oDoc.store()
          merckSave()
       oDoc.setModified(False)
       End If
   End If
   oDoc.close(True)


Back to top
View user's profile Send private message
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