OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > Corel Photo-Paint VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15-12-2006, 17:04
pbisson
Guest
 
Posts: n/a
Default Help with ActiveDocument.PublishToPDF

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 07:08.
Reply With Quote
  #2  
Old 15-12-2006, 20:33
Michael Cervantes
Guest
 
Posts: n/a
Default List box

You could create a list box to open the files in the order you please.

Regards
Reply With Quote
  #3  
Old 16-12-2006, 12:24
pbisson
Guest
 
Posts: n/a
Default

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 07:09.
Reply With Quote
  #4  
Old 18-12-2006, 12:33
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Well, I guess you can't. Same with multi-document output from CorelDRAW. It's not available through automation...
Reply With Quote
  #5  
Old 20-12-2006, 17:22
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

Use pdf.join utility, there are also command-line versions available, some of them free.
Reply With Quote
  #6  
Old 03-01-2007, 20:37
pbisson
Guest
 
Posts: n/a
Default

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 07:09.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:35.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com