Ola @Silmar, segue uma sugestão.
Página inicial, página final e Numero do Processo é digitado na planilha.
A macro:
Sub Imprimir
Dim document, dispatcher, oCel As Object
Dim pgFinal As Integer
Dim pgInicio As Integer
dim args1(0) as new com.sun.star.beans.PropertyValue
dim args11(0) as new com.sun.star.beans.PropertyValue
dim args2(0) as new com.sun.star.beans.PropertyValue
dim args3(0) as new com.sun.star.beans.PropertyValue
dim args12(0) as new com.sun.star.beans.PropertyValue
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
args11(0).Name = "ToPoint"
args11(0).Value = "maximoo"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args11())
oCel = ThisComponent.getCurrentSelection()
pgFinal = oCel.getString()
args1(0).Name = "ToPoint"
args1(0).Value = "inicioo"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
args2(0).Name = "ToPoint"
args2(0).Value = "contadorr"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
oCel = ThisComponent.getCurrentSelection()
pgInicio = oCel.getString()
While pgFinal >= pgInicio
args3(0).Name = "ToPoint"
args3(0).Value = "paginaa"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
dispatcher.executeDispatch(document, ".uno:PrintDefault", "", 0, Array())
Wait 1000
pgInicio = pgInicio + 1
args12(0).Name = "ToPoint"
args12(0).Value = "contadorr"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args12())
GlobalScope.BasicLibraries.LoadLibrary("Tools")
dim Variavel As Long
Variavel = pgInicio
oSheet=ThisComponent.Sheets(0) ' 0 é a primeira planilha
ChangeValueofRange (oSheet, "C2", Variavel)
wend
End Sub
ATENÇÂO:: Caso queira dar mais detalhes a sua pergunta, use na pergunta ou abaixo. Grato.
Caso a resposta atendeu sua necessidade, por gentileza, click na bolinha <img alt=“Descrição da imagem” src="/upfiles/140573724