Tworzę dokument w OpenOffice Calc w którym po naciśnięciu przycisku tworzy mi się nowy arkusz, który jest kopią innego arkusza... Zrobiłem to poprzez nagranie makra...
Kod: Zaznacz cały
sub kopiuj_arkusz2
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 ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Nr"
args1(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(2) as new com.sun.star.beans.PropertyValue
args2(0).Name = "DocName"
args2(0).Value = "kopiowanie arkusza"
args2(1).Name = "Index"
args2(1).Value = 32767
args2(2).Name = "Copy"
args2(2).Value = true
dispatcher.executeDispatch(document, ".uno:Move", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Nr"
args3(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args3())
end sub