Ja, kann ich (2.0.2 unter Win2k)
Ein:
hilft statt der Msg-Box.
Meine Erklärung ist etwas wage, aber gehe davon aus das der Drucker wohl einen kurzen Moment braucht den Druckauftrag anzunehmen und in dieser Zeit keine Befehle entgegennimmt. Ich glaube aber nicht mal das es sich um die Zeit zum 'spoolen' handelt ohne es überprüft zu haben.
Naja, abenteuerliche Begründung.
die IDL-Referenz sagt bzgl. der Wait-
Eigenschaft(s.u.):
"...
@attention Using of this property with TRUE as value is highly reommended. Otherwhise following actions (as e.g. closing the corresponding model) can fail.
..."
Lösung ist:
Code: Alles auswählen
sub kopiendrucken
mydoc=thiscomponent
Dim printProp(1) as New com.sun.star.beans.PropertyValue
printProp(0).Name = "CopyCount"
printProp(0).Value = 1
printProp(1).Name = "Wait"
printProp(1).Value = True
myDoc.Print(printProp())
mySheet = myDoc.sheets(0)
mycell = mysheet.getCellRangeByName("$A$1")
mycell.string = "Rechnungskopie"
printProp(0).Name = "CopyCount"
printProp(0).Value = 3
'msgbox("Kopien werden gedruckt")
myDoc.Print(printProp())
end sub
Gruß
Stephan