Export jpg from each cdr file in a folder

Hi all!

Is there a way to open each file in a folder, do some stuff , export a jpg from each file and close the file?

The problem where I'm stuck is the browsing part for each file in a folder and opening it.

I'm using Corel Draw X6.

Thanks a lot in advance

Parents
No Data
Reply
  • A very quick solution is:

    Sub FilesInAFolder()

    Dim BasePath As String, CurFile As String, CurDoc As Document

    BasePath = "C:\Temp\"
    CurFile = Dir(BasePath + "*.Cdr")
    While CurFile <> ""
       Set CurDoc = Application.OpenDocument(BasePath + CurFile)
    MsgBox CurFile
       ...
       CurDoc.Save
       CurDoc.Close
       CurFile = Dir
    Wend

    End Sub

    When using it, you must not use the 'Dir'-Command inside the While-Wend loop. If you need it, you have to do this loop first and storing the file names in an array.

Children