ich habe arge Probleme zuverlässig auszudrucken...
Fehlermeldung:
"Es sind keine Seiten für den Druck verfügbar.Prüfen sie ihr Dokument auf druckrelevante Inhalte."
Code: Alles auswählen
Global oDok as Object
sub test1
dim myFileProp(0) as New com.sun.star.beans.PropertyValue
myFileProp(0).name="Hidden"
myFileProp(0).value=True
oDok = StarDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, myFileProp() )
end sub
Wird das "Unbenannt 1" immer als Standard erzeugt ?
Code: Alles auswählen
sub test2
oComponents = StarDesktop.getComponents()
oDocs = oComponents.CreateEnumeration()
Do While oDocs.hasMoreElements()
oDoc = oDocs.nextElement()
print "offenes Dokument: " & oDoc.title
Loop
end sub
sheets umbenennen
Code: Alles auswählen
sub test3
Sheets = oDok.Sheets
Sheets.getByIndex(0).Name = "druck"
Sheets.getByIndex(1).Name = "dbank"
Sheets.getByIndex(2).Name = "rg"
end sub
zellen werden noch mit Daten gefüllt
und dann zum druck
Code: Alles auswählen
sub test4
oSheet = oDok.sheets.getByName("druck")
oDok.CurrentController.SetActiveSheet(oSheet)
Dim oRanges(0) As New com.sun.star.table.CellRangeAddress
oRanges(0).Sheet = oSheet.Rangeaddress.sheet
oRanges(0).StartColumn = 0 : oRanges(0).StartRow = 0
oRanges(0).EndColumn = 5 : oRanges(0).EndRow = 60 ' zum testen fester Wert
oSheet.setPrintAreas(oRanges())
Dim myProps(0) as New com.sun.star.beans.PropertyValue
document = oDok.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:PrintDefault", "", 0, myProps())
end sub
wenn ich das Dokument sichtbar erzeuge geht alles...

das Makro und die Dialog liegen jetzt als Extension unter meine dialog....
AOO401m5(Build:9714)
hat jemand ein Tipp für mich?
könnte verzweifeln

gruß marc