






(might have gotten the option's name wrong, since i'm translating from portuguese... but you get the idea)
guedesbrawl wrote:At least they should warn you that such an option exists right as you first boot the program.
Sub SaveAndTimeStampBackup()
Dim sDocURL as string, sBackupURL as string, sTimeStamp as string
Dim oDoc as object
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then
GlobalScope.BasicLibraries.LoadLibrary("Tools")
End If
sTimeStamp = "_" & Format(Year(Now), "0000") & Format(Month(Now), "00") & Format(Day(Now), "00") & "_" & _
Format(Hour(Now), "00") & Format(Minute(Now), "00") & Format(Second(Now), "00")
oDoc = Thiscomponent
If oDoc.hasLocation() then
sDocURL = oDoc.getURL()
sBackupURL = CreateUnoService("com.sun.star.util.PathSettings").Backup & "/" & _
GetFileNameWithoutExtension(sDocURL, "/") & _
sTimeStamp() & "." & _
GetFileNameExtension(sDocURL, "/")
oDoc.store() ' Save
oDoc.storeToURL(sBackupURL, array()) ' Backup
Else
MsgBox("This document have not URL. Can not be archived." & Chr(10) & "Use the normal 'save' procedure.",16,"Warning:")
End if
End sub
Zizi64 wrote:The auto backup function will create only one backup file for one filename (for one document). And then that one backup file will be refreshed at every automatic saving. The errors will be cumulated at every save into that one file .
Return to User Experience (UX)
Users browsing this forum: No registered users and 2 guests