- Code: Select all Expand viewCollapse view
Sub PDF1()
Dim Entry(1 To 4) As String
Entry(1) = "A"
Entry(2) = "B"
Entry(3) = "C"
Entry(4) = "D"
Doc = ThisComponent
oSheet = Doc.CurrentController.getActiveSheet()
oRng = oSheet.getCellRangeByName("A1:I17")
Dim mFilterData(0) As New com.sun.star.beans.PropertyValue
mFilterData(0).Name = "Selection"
Dim mStoreOpts(2) As New com.sun.star.beans.PropertyValue
mStoreOpts(0).Name = "Overwrite"
mStoreOpts(0).Value = True
mStoreOpts(1).Name = "FilterName"
mStoreOpts(1).Value = "calc_pdf_Export"
mStoreOpts(2).Name = "FilterData"
path = "file:///F:/Download/Totale" & Replace(Date,"/","-") & ".pdf"
For Count = 1 To 4
oSheet.getCellRangeByName("C5").String = Entry(Count)
mFilterData(0).Value = oRng
mStoreOpts(2).Value = mFilterData()
sUrl = "file:///F:/Download/"& Entry(Count) & " " & Replace(Date,"/","-") & ".pdf" 'Cel.getString()
Doc.storeToURL(sURL, mStoreOpts())
next
end sub
My goal is an unique PDF with all changes.
File attached