Wie kann ich vor dem Speichern überprüfen ob eine Datei mit gleichem Namem existiert und dieser dann ggf. eine fortlaufende Nummer anhängen, z.B. name001.odt?
Code: Alles auswählen
Sub Save_as_ODT
proofAllOptGrp1
if iError > 0 then
MsgBox "Sie haben noch "& iError &" Fehler zu beheben", 0+48, "Achtung"
exit Sub
else
oform = thisComponent.drawpage.forms.getbyindex(0)
aText = oForm.getByName("txt_oName")
if aText.text = "" then
datname = "blanc"
else
datname = aText.text
end if
path = "C:/Roiger/Auftraege/"
extension = ".odt"
odturl = "file:///" + path + datname + extension
thisComponent.storeToURL(odturl, Array())
clearForm
endif
End Sub