ich glaub ich hab mich vergallopiert und letztlich hängt es nur an einer Kleinigkeit wieso das Speichern nicht mehr funktioniert.
Code: Alles auswählen
Sub Save_as_ODT
Dim antwort
Dim speichern
Dim pages
oform = thisComponent.drawpage.forms.getbyindex(0)
aNum = oForm.getByName("txt_oKey")
pages = thiscomponent.CurrentController.PageCount
datname = aNum.text
path = "C:/Roiger/Auftraege/"
extension = ".odt"
if thisComponent.title = "Auftrag_Form1.odt" then
proofAllOptGrp1
else
proofAllOptGrp2
end if
if iError > 0 then
MsgBox "Sie haben noch "& iError &" Fehler zu beheben", 0+48, "Achtung"
elseif thisComponent.title <> "Auftrag_Form1.odt" and pages < 2 then
MsgBox "Sie müßen noch min. 1 Prüfprotokoll anfügen", 0+48, "Achtung"
exit Sub
end if
if iError = 0 and thisComponent.title <> "Auftrag_Form1.odt" then
antwort = MsgBox ("Waren Ihre Prüfungen ohne Beanstandungen", 4+32, "Frage")
if antwort = 7 then
datname = "X_&datname
end if
odturl = "file:///" + path + datname + extension
msgbox odturl
if FileExists (odturl) then
speichern = MsgBox ("Eine Datei mit dem Namen" & CHR$(10) & odturl1 & CHR$(10) & "existiert bereits!" _
& CHR$(10) & "Soll sie überschrieben werden?",4+48, "Achtung")
if speichern = 7 then
msgbox "Datei wurde nicht gespeichert", 0, "Information"
exit sub
else
if thisComponent.title = "Auftrag_Form1.odt" then
thisComponent.storeToURL(odturl, Array())
else
thisComponent.storeAsURL(odturl, Array())
endif
msgbox "Datei wurde gespeichert", 0, "Information"
end if
endif
end if
End Sub