I am using CorelDraw X7 and have a document consisting of four pages.
I wish to save one or all of these pages to a cdr file. According to the Macros Help the cdrExportRange variable has three possible values, 0 for all pages, 1 for the current page only and 2 for saving only selected objects on a page.
The sub below is a slightly modified version of on presented in CorelDraw Help:Sub Test() Dim RangeValue As Long Dim so As New StructSaveAsOptions Debug.Print cdrAllPages, cdrCurrentPage, cdrSelection ' To confirm values' so.Range = cdrAllPages ' 0' so.Range = cdrCurrentPage ' 1' so.Range = cdrSelection ' 2 RangeValue = 1 so.Range = RangeValue ActiveDocument.SaveAs "C:\Users\Holger\Test\File" & RangeValue & ".cdr", soEnd SubIf I run this with values 0 and 2 it performs as expected, creating a file with either all pages or with the selected objects only.But if I run it with the value 1, I get a"Run-time error '...' (80070067): Parameter Range cannot be 1".My intention is to save each page to separate files, so this behavior is frustrating.Am I doing something wrong here?
I see the same result.
In this thread on the Oberon Place forum, someone describes a similar problem, and ends up using the workaround of selecting everything on the page, then using the "cdrSelection" option.
Besides that you can use a custom macro, you can save one page by selecting all objects, then choose "save as..." (Ctrl+Shift+S) with a different name, and select "selected objects"
If you need to save each page of a multipage document, the Multipage Export macro from MacroMonster allows to export all pages or some pages as CDR, JPG, etc as individual files
http://macromonster.com/product/woxxom-multipage-export-to-bitmaps/
@Eskimo: Thank you for the confirmation. The link you refer to is from 2009, so the error seems to have been around for at least 8 years. I wonder if it also occurs in the newest version of CorelDraw.
I will try the work-around of selecting all objects on the active page.
@Ariel: Thank you for the MacroMonster link.
Their export macro is free, I downloaded it and found out, that it comes with source code. A quick search shows, that they indeed use "cdrCurrentPage" when saving to JPG-files. I ran the macro, and it saves individual pages, although with a huge size. I have to look deeper into the code to find out how they avoid the error message.
sir this thread can save all the pages in this codeand if someone need to save few specific page then?