![]() |
#1
|
|||
|
|||
![]()
Hey all:
I'm using PP 12 and I would like to write a VBA macro to dump the currently open set of documents to a PDF. Yes, I know about the File|Publish to PDF menu pick. However, when the PDF file dialog opens, the file order depends upon the order of how PP opens the files (I don't want to open them one at a time, there are too many). Often, the order PP opens the files is not the page order I want in the PDF document. I want to open the files programmatically, in the order I want, and then push them all to a multiple page PDF document. I can dump a single file to a PDF using the ActiveDocument.PublishToPDF method. However, unlike Corel Draw, documents in Photo-Paint do not have multiple pages (not a movie either!). When I try setting the PublishRange to pdfPageRange, (and set the PageRange to a CSV list of the open file names), VB chokes and complains: Run-time error '-2147467259(800004005)': Method 'PublishToPDF' of object IPaintDocument' failed. This is so even if I use a page range like: "1-5" for example. Here's some code: '** This works for the active document ** Sub DumpPDF() With ActiveDocument.PDFSettings ' .PublishRange = pdfPageRange ' .PageRange = "<opened filename1>, <opened filename2>, etc" End With ActiveDocument.PublishToPDF ("<path>\test.pdf") End Sub If I enable the PublishRange and PageRange lines, I get the error described above. Somehow, PP does a multi-document dump to a single PDF file. How can I do this too? Thanks in advance! ________ Bubbler Pipe Last edited by pbisson; 27-08-2011 at 08:08. |
#2
|
|||
|
|||
![]()
You could create a list box to open the files in the order you please.
Regards |
#3
|
|||
|
|||
![]()
I'm not interested in how to make the list of files, that's not the problem. I'm interested in how to make .PublishToPDF dump multiple PP documents to a single, multi-page PDF file. I don't want to bring up the PDF dialog box and interact with the user.
Somehow PP allows the user to dump multiple docs to a single PDF through the File|Publish To PDF menu pick, and I'd like to do that programmatically. Sorry for the confusion ________ Nightdreams Live Last edited by pbisson; 27-08-2011 at 08:09. |
#5
|
||||
|
||||
![]()
Use pdf.join utility, there are also command-line versions available, some of them free.
|
#6
|
|||
|
|||
![]()
OK, thanks everyone for your help. I'll use an external utility to join the PP generated PDF's.
________ buy a condo in Pattaya Last edited by pbisson; 27-08-2011 at 08:09. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|