You are on page 1of 6

REM ***** BASIC *****

sub temp_csv_V01
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
dim ruta
dim final
dim tramo
dim hito

hito = InputBox (" Escribe una opción -->> a. 01 / b. 02: ")


tramo = InputBox (" Escribe una valor del tramo: ")
final = InputBox (" Escribe cantidad de celdas: ")

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(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$A$4:$T$1000"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())

rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ToPoint"
args3(0).Value = "$A$3:$T$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())

rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "EndCell"
args4(0).Value = "$T$" & final

dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args4())

rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "ToPoint"
args5(0).Value = "$A$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args5())

rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Nr"
args6(0).Value = 3

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 = "$A$4:$U$1000"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())

rem ----------------------------------------------------------------------
dim args9(0) as new com.sun.star.beans.PropertyValue
args9(0).Name = "ToPoint"
args9(0).Value = "$A$3:$U$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args9())

rem ----------------------------------------------------------------------
dim args10(0) as new com.sun.star.beans.PropertyValue
args10(0).Name = "EndCell"
args10(0).Value = "$U$" & final

dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args10())

rem ----------------------------------------------------------------------
dim args11(0) as new com.sun.star.beans.PropertyValue
args11(0).Name = "ToPoint"
args11(0).Value = "$A$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args11())

rem ----------------------------------------------------------------------
dim args12(0) as new com.sun.star.beans.PropertyValue
args12(0).Name = "Nr"
args12(0).Value = 4

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args12())

rem ----------------------------------------------------------------------
dim args13(0) as new com.sun.star.beans.PropertyValue
args13(0).Name = "ToPoint"
args13(0).Value = "$A$4:$S$1000"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args13())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())

rem ----------------------------------------------------------------------
dim args15(0) as new com.sun.star.beans.PropertyValue
args15(0).Name = "ToPoint"
args15(0).Value = "$A$3:$S$3"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args15())

rem ----------------------------------------------------------------------
dim args16(0) as new com.sun.star.beans.PropertyValue
args16(0).Name = "EndCell"
args16(0).Value = "$S$" & final

dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args16())

rem ----------------------------------------------------------------------
dim args17(0) as new com.sun.star.beans.PropertyValue
args17(0).Name = "ToPoint"
args17(0).Value = "$A$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args17())

rem ----------------------------------------------------------------------
dim args18(0) as new com.sun.star.beans.PropertyValue
args18(0).Name = "Nr"
args18(0).Value = 5

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args18())

rem ----------------------------------------------------------------------
dim args19(0) as new com.sun.star.beans.PropertyValue
args19(0).Name = "ToPoint"
args19(0).Value = "$A$4:$P$1000"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args19())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())

rem ----------------------------------------------------------------------
dim args21(0) as new com.sun.star.beans.PropertyValue
args21(0).Name = "ToPoint"
args21(0).Value = "$A$3:$P$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args21())

rem ----------------------------------------------------------------------
dim args22(0) as new com.sun.star.beans.PropertyValue
args22(0).Name = "EndCell"
args22(0).Value = "$P$" & final

dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args22())

rem ----------------------------------------------------------------------
dim args23(0) as new com.sun.star.beans.PropertyValue
args23(0).Name = "ToPoint"
args23(0).Value = "$A$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args23())

rem ----------------------------------------------------------------------
dim args24(0) as new com.sun.star.beans.PropertyValue
args24(0).Name = "Nr"
args24(0).Value = 6
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args24())

rem ----------------------------------------------------------------------
dim args27(0) as new com.sun.star.beans.PropertyValue
args27(0).Name = "ToPoint"
args27(0).Value = "$A$4:$Y$1000"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args27())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:ClearContents", "", 0, Array())

rem ----------------------------------------------------------------------
dim args29(0) as new com.sun.star.beans.PropertyValue
args29(0).Name = "ToPoint"
args29(0).Value = "$A$3:$Y$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args29())

rem ----------------------------------------------------------------------
dim args30(0) as new com.sun.star.beans.PropertyValue
args30(0).Name = "EndCell"
args30(0).Value = "$Y$" & final

dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args30())

rem ----------------------------------------------------------------------
dim args31(0) as new com.sun.star.beans.PropertyValue
args31(0).Name = "ToPoint"
args31(0).Value = "$A$3"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args31())

rem ----------------------------------------------------------------------
dim args32(0) as new com.sun.star.beans.PropertyValue
args32(0).Name = "Nr"
args32(0).Value = 2

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args32())

rem ----------------------------------------------------------------------
dim args33(2) as new com.sun.star.beans.PropertyValue
args33(0).Name = "URL"
args33(0).Value = "file:///run/media/luis/Base/@Cart_hito_02-vanos/SHP%20-%20HITO_"
& hito & "/2.%20KMZ%20-%20" & tramo & "/TEMP-CSV-" & tramo & "/FIBRA_OPTICA.csv"
args33(1).Name = "FilterName"
args33(1).Value = "Text - txt - csv (StarCalc)"
args33(2).Name = "FilterOptions"
args33(2).Value = "44,34,76,1,,0,false,true,true,false,false"

dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args33())

rem ----------------------------------------------------------------------
dim args34(0) as new com.sun.star.beans.PropertyValue
args34(0).Name = "Nr"
args34(0).Value = 3

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args34())


rem ----------------------------------------------------------------------
dim args35(2) as new com.sun.star.beans.PropertyValue
args35(0).Name = "URL"
args35(0).Value = "file:///run/media/luis/Base/@Cart_hito_02-vanos/SHP%20-%20HITO_"
& hito & "/2.%20KMZ%20-%20" & tramo & "/TEMP-CSV-" & tramo &
"/INFRAESTRUCTURA_APOYO.csv"
args35(1).Name = "FilterName"
args35(1).Value = "Text - txt - csv (StarCalc)"
args35(2).Name = "FilterOptions"
args35(2).Value = "44,34,76,1,,0,false,true,true,false,false"

dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args35())

rem ----------------------------------------------------------------------
dim args36(0) as new com.sun.star.beans.PropertyValue
args36(0).Name = "Nr"
args36(0).Value = 4

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args36())

rem ----------------------------------------------------------------------
dim args37(2) as new com.sun.star.beans.PropertyValue
args37(0).Name = "URL"
args37(0).Value = "file:///run/media/luis/Base/@Cart_hito_02-vanos/SHP%20-%20HITO_"
& hito & "/2.%20KMZ%20-%20" & tramo & "/TEMP-CSV-" & tramo & "/RT_EMPALME.csv"
args37(1).Name = "FilterName"
args37(1).Value = "Text - txt - csv (StarCalc)"
args37(2).Name = "FilterOptions"
args37(2).Value = "44,34,76,1,,0,false,true,true,false,false"

dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args37())

rem ----------------------------------------------------------------------
dim args38(0) as new com.sun.star.beans.PropertyValue
args38(0).Name = "Nr"
args38(0).Value = 5

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args38())

rem ----------------------------------------------------------------------
dim args39(2) as new com.sun.star.beans.PropertyValue
args39(0).Name = "URL"
args39(0).Value = "file:///run/media/luis/Base/@Cart_hito_02-vanos/SHP%20-%20HITO_"
& hito & "/2.%20KMZ%20-%20" & tramo & "/TEMP-CSV-" & tramo & "/RT_NODO-NOC-CM.csv"
args39(1).Name = "FilterName"
args39(1).Value = "Text - txt - csv (StarCalc)"
args39(2).Name = "FilterOptions"
args39(2).Value = "44,34,76,1,,0,false,true,true,false,false"

dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args39())

rem ----------------------------------------------------------------------
dim args40(0) as new com.sun.star.beans.PropertyValue
args40(0).Name = "Nr"
args40(0).Value = 6

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args40())

rem ----------------------------------------------------------------------
dim args41(2) as new com.sun.star.beans.PropertyValue
args41(0).Name = "URL"
args41(0).Value = "file:///run/media/luis/Base/@Cart_hito_02-vanos/SHP%20-%20HITO_"
& hito & "/2.%20KMZ%20-%20" & tramo & "/CSV/CSV-" & tramo & ".csv"
args41(1).Name = "FilterName"
args41(1).Value = "Text - txt - csv (StarCalc)"
args41(2).Name = "FilterOptions"
args41(2).Value = "44,34,76,1,,0,false,true,true,false,false"

dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args41())

end sub

You might also like