von komma4 » Do, 27.11.2008 21:31
Für jemanden, der eine automatische Sicherungskopie (an anderer Stelle) beim Speichern möchte:
Code: Alles auswählen
Sub copyBackupToHarddrive
' load TOOLS library with helper function
If NOT GlobalScope.BasicLibraries.isLibraryLoaded( "Tools" ) Then
GlobalScope.BasicLibraries.LoadLibrary( "Tools" )
End If
If ThisComponent.hasLocation() Then
extraDrivePath = "/zentrale/firma/2008/"
fn = FileNameoutofPath( ThisComponent.getURL() )
ThisComponent.storeToURL( ConvertToURL( extraDrivePath & fn ), Array() )
Else
msgbox "Datei hat keine URL - kann keine Kopie erstellen ",, "copyBackupToHarddrive"
End If
End Sub
a) Den Code in ein Modul der
Meine Macros & Dialoge.Standard-Bibliothek kopieren.
b) Pfadinformation in der Variablen
extraDrivePath anpassen
c) Bei jeder Datei, die so gesichert werden soll, das Makro unter
Extras>Anpassen...>Ereignisse>Datei wurde gesichert zuordnen.
Eine vorhandene Kopie wird ohne Rückfrage überschrieben!
Viel Spass damit!
Für jemanden, der eine automatische Sicherungskopie (an anderer Stelle) beim Speichern möchte:
[code]
Sub copyBackupToHarddrive
' load TOOLS library with helper function
If NOT GlobalScope.BasicLibraries.isLibraryLoaded( "Tools" ) Then
GlobalScope.BasicLibraries.LoadLibrary( "Tools" )
End If
If ThisComponent.hasLocation() Then
extraDrivePath = "/zentrale/firma/2008/"
fn = FileNameoutofPath( ThisComponent.getURL() )
ThisComponent.storeToURL( ConvertToURL( extraDrivePath & fn ), Array() )
Else
msgbox "Datei hat keine URL - kann keine Kopie erstellen ",, "copyBackupToHarddrive"
End If
End Sub[/code]
a) Den Code in ein Modul der [color=#008000]Meine Macros & Dialoge[/color].Standard-Bibliothek kopieren.
b) Pfadinformation in der Variablen [color=#008000]extraDrivePath[/color] anpassen
c) Bei jeder Datei, die so gesichert werden soll, das Makro unter [color=#008000]Extras>Anpassen...>Ereignisse>Datei wurde gesichert[/color] zuordnen.
[color=#FF0000]Eine vorhandene Kopie wird ohne Rückfrage überschrieben![/color]
Viel Spass damit!