Exporting Multiple PNG Images of Selected Items in CorelDRAW 12 using Macro (VBA)
In this article, we will discuss how to export multiple PNG images of selected items in CorelDRAW 12 using a Macro (VBA). This technique can be useful for designers who need to export multiple images quickly and efficiently.
Prerequisites
Before we begin, make sure you have the following:
- CorelDRAW 12 installed on your computer
- A basic understanding of VBA and macros
Creating the Macro
To create the macro, follow these steps:
- Open CorelDRAW 12
- Press Alt + F11 to open the VBA editor
- In the VBA editor, click Insert → Module
- Copy and paste the following code into the new module:
Sub ExportMultiplePNGs() Dim myDoc As Document Dim mySelection As ShapeRange Dim myShape As Shape Dim myPath As String ' Set the path to the exported images myPath = "C:\MyImages\" ' Get the active document Set myDoc = ThisDrawing ' Get the selected shapes Set mySelection = myDoc.Selection ' Loop through each shape in the selection For Each myShape In mySelection ' Export the shape as a PNG image myShape.Export myPath & myShape.Name & ".png", ExportFormatEnum.expng Next myShape ' Display a message to indicate success MsgBox "Multiple PNG images exported successfully!", vbInformation, "Success" End SubNote: Replace
"C:\MyImages\"with the path where you want to save the exported images. - Save the macro with a descriptive name, such as
ExportMultiplePNGs.vb - Close the VBA editor
Running the Macro
To run the macro, follow these steps:
- Select the items you want to export as PNG images
- Press Alt + F8 to open the Macros dialog box
- Select the macro you created and click Run
- The macro will export each selected item as a PNG image to the specified path
References
- CorelDRAW Macros
- Macro to export multiple PNG images in CorelDRAW
- Corel Draw Macro to Export Multiple PNGs
In this article, we discussed how to export multiple PNG images of selected items in CorelDRAW 12 using a Macro (VBA). By following the steps outlined in this article, you can quickly and efficiently export multiple images without having to manually export each one.