makro ile gizli sayfayı yazdırma
Gönderilme zamanı: 23 Kas 2018, 13:43
aşağıdaki makro ile sayfayı yazdırabiliyorum ancak yazdıracağım listeçıktı sayfasını gizleyince yazdırmıyor, bunu nasıl yazdırabilirim ve yazdırma sonrası o calc o sayfayada kalıyor tuşa bastığım sayfaya döndürebilir miyim
sub listeckt
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 = "Printer"
dispatcher.executeDispatch(document, ".uno:Printer", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(2) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Copies"
args2(1).Name = "RangeText"
args2(1).Value = "1"
args2(2).Name = "Collate"
args2(2).Value = true
dispatcher.executeDispatch(document, ".uno:Print", "", 0, args2())
rem ----------------------------------------------------------------------
document = ThisComponent 'assigns the current document to the variable document
Sheets = document.Sheets 'get the container of all Sheets
Sheet = Sheets.getByName("listeçıktı") 'get the sheet named Sheet1
Controller = document.getcurrentController
Controller.setActiveSheet(Sheet)
end sub
sub listeckt
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 = "Printer"
dispatcher.executeDispatch(document, ".uno:Printer", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(2) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Copies"
args2(1).Name = "RangeText"
args2(1).Value = "1"
args2(2).Name = "Collate"
args2(2).Value = true
dispatcher.executeDispatch(document, ".uno:Print", "", 0, args2())
rem ----------------------------------------------------------------------
document = ThisComponent 'assigns the current document to the variable document
Sheets = document.Sheets 'get the container of all Sheets
Sheet = Sheets.getByName("listeçıktı") 'get the sheet named Sheet1
Controller = document.getcurrentController
Controller.setActiveSheet(Sheet)
end sub