I am trying to export pages from two different sheets of a workbook as 1 PDF.
However, I want the pages to be in this order: 1 page from Sheet1, 5 pages from Sheet2, 2 pages from Sheet1.
At the moment I am exporting these as 3 seperate PDFs and then merging them afterwards in another application.
The code I have been using is below:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=sPath & quotept1filename, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=1, To:=1, OpenAfterPublish:=False
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=sPath & quotept2filename, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=2, To:=3, OpenAfterPublish:=False
Sheets("PPA Print Ready Quote").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=sPath & optionsfilename, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=1, To:=NumberOfOptions, OpenAfterPublish:=False
How can I get them to print as one PDF in the order I want?
It may not seem like the best way, but I personally use a driver such a PrimoPDF to do this. By printing all the pages required to PrimoPDF you will gain one pdf file in the same order that it would appear if you were sending to a standard printer.
It can be downloaded for free here http://www.primopdf.com/
来源:https://stackoverflow.com/questions/13804102/exporting-multiple-pages-to-pdf-in-a-specific-order