I'm not hopeful, but is there by chance a way to export layers separately? i.e. if a PP project has say 10 layers am I able to export them as individual images? I know I can do it one at a time with the "export selected only" setting, but I'm looking for a way to do it all in one shot.
I hadn't tried this before, and make no claims that it's "good code", but this seemed to work OK for me in a couple of tests I tried in X7.
Sub save_layers_as_files()Dim index_counter As LongDim layer_name As StringDim orig_filenameDim saveas_filename As StringDim d As Documentorig_filename = ActiveDocument.FileNameFor index_counter = 1 To ActiveDocument.Layers.Count 'get layer name layer_name = ActiveDocument.Layers(index_counter).Name 'cook up new filename saveas_filename = "C:\Temp\" & orig_filename & "_" & layer_name & ".PNG" 'copy this layer ActiveDocument.Layers.Item(index_counter).Copy 'new document from clipboard Set d = Application.CreateDocumentFromClipboard 'saveas this document d.SaveAs(saveas_filename, cdrPNG).Finish 'close this document ActiveDocument.CloseNext index_counterEnd Sub
Note that, in the SaveAs, you get to select the export filter. In the code shown above, I made it PNG.
When doing the SaveAs, one can also use "StructSaveOptions" to set the details for how the export is carried out. I don't know the details of how to implement that, but I know that it exists.
PJ said:Thanks for going to the trouble, Myron. How do I use this script?
In this thread, I tried to type out a quick description of how to get started with a macro in CorelDraw X7.
I don't know how close that is to Photo-Paint X6.
Apologies, Eskimo—I credited Myron for your script when it was actually your reply to him.
PJ said: Apologies, Eskimo—I credited Myron for your script when it was actually your reply to him.
Hey, no harm, no foul - and thanks for noticing!
Myron did have a significant hand in my participation, too. He invited me to the thread, described the problem, and gave me the code he had already written to use as a jumping-off point.
The way the form handles thread makes it easy for things to get confusing.