Exporting multiple pages to PDF in a specific order

99封情书 提交于 2019-12-02 01:19:51

问题


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?


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!