| View previous topic :: View next topic |
| Author |
Message |
PaulJayD General User

Joined: 14 Sep 2007 Posts: 12
|
Posted: Wed Oct 10, 2007 12:18 pm Post subject: Intercept 'Save' Upon 'Close' |
|
|
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 |
|
 |
talmai General User

Joined: 11 Jul 2008 Posts: 10 Location: Salvador/BA - Brasil
|
|
| Back to top |
|
 |
DVezina OOo Advocate

Joined: 29 Sep 2006 Posts: 248 Location: Orlando
|
Posted: Wed Jul 16, 2008 11:36 am Post subject: |
|
|
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 |
|
 |
|