von mangostane » Mi, 22.10.2014 16:57
.....hätte dazu
→ viewtopic.php?f=1&t=64713 doch noch eine Frage....
Wie kann ich in dem Makro das Datumformat so ändern, dass auch noch der Tag dabei steht ?
Also nicht nur 29.11.2014 .... sondern Sa.29.11.2014
Ansonsten hat alles wunderbar geklappt.
Code: Alles auswählen
Sub Drucken
Dim Anzahl as integer
oDoc = thisComponent
oController = oDoc.getCurrentController()
oform=odoc.drawpage.forms.getbyindex(0)
oKontroll = oForm.getByName("Datumsfeld 1")
iDate = oKontroll.date
Anzahl = inputbox("Bitte Anzahl eingeben:","Dokument drucken")
for i = 0 To Anzahl -1
oText = oDoc.Text
oFrames=odoc.getTextFrames()
oFrame=oFrames.getByIndex(0)
oFrameCursor=oFrame.createTextCursor()
oFrameCursor.gotoEnd(true)
oFrameCursor.String = "Datum: " & CDateFromIso(iDate) +i
Dim printProp() as New com.sun.star.beans.PropertyValue
oDoc.Print(printProp())
Wait 1000
next
MsgBox "Der Druckauftrag ist abgeschlossen. " ,64, "Dokument drucken"
End Sub
_________________
Moderation: Zur übersichtlichen Darstellung des Textes und des Programmcodes im Text [code][/code] Tags gesetzt.
Thema geteilt und von OOo Writer hierher verschoben, wo alle Themen zur individuellen Programmierung hingehören.
lorbass, Moderator
.....hätte dazu [color=#00AA00]→ http://de.openoffice.info/viewtopic.php?f=1&t=64713[/color] doch noch eine Frage....
Wie kann ich in dem Makro das Datumformat so ändern, dass auch noch der Tag dabei steht ?
Also nicht nur 29.11.2014 .... sondern Sa.29.11.2014
Ansonsten hat alles wunderbar geklappt.
[code]Sub Drucken
Dim Anzahl as integer
oDoc = thisComponent
oController = oDoc.getCurrentController()
oform=odoc.drawpage.forms.getbyindex(0)
oKontroll = oForm.getByName("Datumsfeld 1")
iDate = oKontroll.date
Anzahl = inputbox("Bitte Anzahl eingeben:","Dokument drucken")
for i = 0 To Anzahl -1
oText = oDoc.Text
oFrames=odoc.getTextFrames()
oFrame=oFrames.getByIndex(0)
oFrameCursor=oFrame.createTextCursor()
oFrameCursor.gotoEnd(true)
oFrameCursor.String = "Datum: " & CDateFromIso(iDate) +i
Dim printProp() as New com.sun.star.beans.PropertyValue
oDoc.Print(printProp())
Wait 1000
next
MsgBox "Der Druckauftrag ist abgeschlossen. " ,64, "Dokument drucken"
End Sub[/code]
[color=#00AA00]
_________________
[size=85][b]Moderation:[/b] Zur übersichtlichen Darstellung des Textes und des Programmcodes im Text [code][/code] Tags gesetzt.
Thema geteilt und von [url=http://de.openoffice.info/viewforum.php?f=1]OOo Writer[/url] hierher verschoben, wo alle Themen zur individuellen Programmierung hingehören.
lorbass, Moderator
[/size][/color]