viewtopic.php?f=20&t=79013
The issue i am facing is that pdf created doesn't have a name its kept blank. Is there any way out of this.
I have value at C4 customer name. Can i save pdf in name of customer. I mean depending the value of C4.
Code: Select all
sub mypdf
dim args2(1) as new com.sun.star.beans.PropertyValue
dim Arg(0) as new com.sun.star.beans.PropertyValue
Doc = ThisComponent
Controller = Doc.CurrentController
Sheet = Doc.Sheets.getByName("privatecarprint")
CellRange = Sheet.getCellRangeByName("$A$1:$H$30")
Controller.select(CellRange)
Cell = Sheet.getCellByPosition(6,10)
'Got this here http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export
'See also http://user.services.openoffice.org/en/forum/viewtopic.php?f=44&t=1804
Arg(0).Name = "Selection"
Arg(0).Value = CellRange
args2(0).Name = "FilterName"
args2(0).Value = "calc_pdf_Export"
args2(1).Name = "FilterData"
args2(1).Value = Arg()
Doc.storeToURL("file:///c:/users/lic/Desktop/"& Cell.getString()&".pdf",args2())
end sub