OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 27-03-2003, 05:09
Posts: n/a
Default VB and Corel

Hi, I have a need to open all files in a directory, apply certain filter types and then save the files again. I'm fine with VB but new ro the Corel (10) side of things. I would really like to do this in VB6.

Anyone got any sample code to get me started?

Reply With Quote
Old 31-03-2003, 14:00
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4
Default Re: VB and Corel


You just need to use VB's Dir function to iterate through all the files in a folder, then open them one by one, do whatever you need and then save. For example:

Sub Test()
    Const InPath As String = "C:\Input\"
    Const OutPath As String = "C:\Output\"
    Dim f As String
    Dim doc As CorelDRAW.Document
    f = Dir(InPath & "*.cdr")
    While f <> ""
        Set doc = CorelDRAW.OpenDocument(InPath & f)
        ' .... Do something to your document here
        doc.SaveAs OutPath & f
        f = Dir() ' Find next file
End Sub
This is briefly what you need to do...
Reply With Quote

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Corel Technology Partner Program Survey Alex CorelDRAW/Corel DESIGNER VBA 4 05-05-2005 10:00
run macro at start up Corel 11 ???? -=HKLC=- CorelDRAW/Corel DESIGNER VBA 14 30-10-2004 10:29
Is Corel to Excel data exchange possible? alex69 CorelDRAW/Corel DESIGNER VBA 8 24-06-2004 05:52
Side window ?! in Corel Draw.11 CorelUser CorelDRAW/Corel DESIGNER VBA 1 14-07-2003 00:51
Corel Capture 8 and Corel Script Helix CorelDRAW CS 0 13-12-2002 19:10

All times are GMT -5. The time now is 23:45.

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