![]() |
|
#1
|
|||
|
|||
![]()
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? Thanks, Tull. |
#2
|
||||
|
||||
![]()
Tull,
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: Code:
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 doc.Close f = Dir() ' Find next file Wend End Sub |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |