con il registra macro e scopiazzando un po in giro ho fatto questa macro, in allegato,
però non mi stampa la parte richiesta: foglio25 area"$AG$2:$AJ$24"
non capisco perchè non quello indicato ma l'ultima area visualizzata.
grazie, del vostro aiuto.
Codice: Seleziona tutto
"sub StampaRegistraCassa
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Nr"
args1(0).Value = 25 'Foglio da aprire
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args1())
rem ----------------------------------------------------------------------
dim args61(0) as new com.sun.star.beans.PropertyValue
args61(0).Name = "ToPoint"
args61(0).Value = "$AG$2:$AJ$24" 'area da stampare
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args61())
dispatcher.executeDispatch(document, ".uno:DefinePrintArea", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:Print", "", 0, Array())
rem ----------------------------------------------------------------------
dim args7X(0) as new com.sun.star.beans.PropertyValue
args7X(0).Name = "ToPoint"
args7X(0).Value = "$AC$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7X())
rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Nr"
args6(0).Value = 13
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args6())
rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "ToPoint"
args7(0).Value = "$EY$10"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7())
rem ----------------------------------------------------------------------
dim args8(0) as new com.sun.star.beans.PropertyValue
args8(0).Name = "ToPoint"
args8(0).Value = "$EY$10:$FS$11"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args8())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args10(0) as new com.sun.star.beans.PropertyValue
args10(0).Name = "Nr"
args10(0).Value = 16
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args10())
rem ----------------------------------------------------------------------
dim args11(0) as new com.sun.star.beans.PropertyValue
args11(0).Name = "Nr"
args11(0).Value = 12
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args11())
rem ----------------------------------------------------------------------
dim args12(0) as new com.sun.star.beans.PropertyValue
args12(0).Name = "ToPoint"
args12(0).Value = "$E$10000"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args12())
rem ----------------------------------------------------------------------
dim args13(1) as new com.sun.star.beans.PropertyValue
args13(0).Name = "By"
args13(0).Value = 1
args13(1).Name = "Sel"
args13(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoUpToStartOfData", "", 0, args13())
rem ----------------------------------------------------------------------
dim args14(1) as new com.sun.star.beans.PropertyValue
args14(0).Name = "By"
args14(0).Value = 1
args14(1).Name = "Sel"
args14(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args14())
rem ----------------------------------------------------------------------
dim args15(0) as new com.sun.star.beans.PropertyValue
args15(0).Name = "ToPoint"
args15(0).Value = "$E$10000"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args15())
rem ----------------------------------------------------------------------
dim args16(1) as new com.sun.star.beans.PropertyValue
args16(0).Name = "By"
args16(0).Value = 1
args16(1).Name = "Sel"
args16(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoUpToStartOfData", "", 0, args16())
rem ----------------------------------------------------------------------
dim args17(1) as new com.sun.star.beans.PropertyValue
args17(0).Name = "By"
args17(0).Value = 1
args17(1).Name = "Sel"
args17(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args17())
rem ----------------------------------------------------------------------
dim args18(5) as new com.sun.star.beans.PropertyValue
args18(0).Name = "Flags"
args18(0).Value = "SVD"
args18(1).Name = "FormulaCommand"
args18(1).Value = 0
args18(2).Name = "SkipEmptyCells"
args18(2).Value = false
args18(3).Name = "Transpose"
args18(3).Value = false
args18(4).Name = "AsLink"
args18(4).Value = false
args18(5).Name = "MoveMode"
args18(5).Value = 4
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args18())
end sub"