OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21-11-2007, 02:45
Oliver Siebert
Guest
 
Posts: n/a
Default CDGS X3: Print different files via macro

Hi, corel users!

Is there a way for printing out many CDR-files via macro?

thx for your help.
Reply With Quote
  #2  
Old 21-11-2007, 03:05
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

it may be easy.
How do you think you'll be compiling a list of files to be printed? text file list or interactive dialog?
if it's nothing fancy then there could be a 10-20 lines of vba code
Reply With Quote
  #3  
Old 21-11-2007, 03:55
Oliver Siebert
Guest
 
Posts: n/a
Default

1) a simple box to specify the source directory (like FileConverter.gms)
2) print out all CDR-files in this directory (without a printer dialog - just the standard printer)
Reply With Quote
  #4  
Old 21-11-2007, 04:48
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

something like this then:
Code:
Sub PrintCDRFolder()
   Dim fo$, fi$, doc As Document, log$, tmp$, hFile&
   fo = CorelScriptTools.GetFileBox("CorelDRAW documents (*.cdr)|*.cdr", "Print all CDR files in folder", 0, , , _
      GetSetting("CorelDRAW", "PrintCDRFolder", "Folder"), "Print ALL")
   If Len(fo) = 0 Then Exit Sub
   fo = Left$(fo, InStrRev(fo, "\"))
   SaveSetting "CorelDRAW", "PrintCDRFolder", "Folder", fo
   
   fi = Dir(fo & "*.cdr")
   EventsEnabled = False
   On Error Resume Next
   Do While Len(fi)
      Set doc = OpenDocument(fo & fi)
      DoEvents
      If doc Is Nothing Then
         log = log & fi & ": error opening" & vbCr
      Else
         doc.PrintOut
         doc.Close
         log = log & fi & vbCr
      End If
      
      fi = Dir()
   Loop
   EventsEnabled = True
   Kill tmp
   
   hFile = FreeFile()
   tmp = Environ$("temp") & "\printCDRfolder.log"
   Kill tmp
   Open tmp For Binary Access Write Lock Read Write As #hFile
   Put #hFile, , log
   Close #hFile

   Shell "notepad """ & tmp & """", vbNormalFocus
End Sub
to cancel the macro: press Ctrl-Break
Reply With Quote
  #5  
Old 21-11-2007, 05:32
Oliver Siebert
Guest
 
Posts: n/a
Default

THANK YOU VERY VERY MUCH. You are great! It works!
Reply With Quote
Reply


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
In need of macro to import multiple GIF's onto template opinionsrfun CorelDRAW/Corel DESIGNER VBA 31 12-10-2007 13:22
Need macro to number files sequentially in Corel Draw opinionsrfun CorelDRAW/Corel DESIGNER VBA 21 04-09-2007 10:35
Macro for retaining EXIF data in CTP files Shabbadang Macros/Add-ons 0 16-05-2007 01:49
finding node angles? IanVincent CorelDRAW/Corel DESIGNER VBA 4 12-12-2003 23:32
New macro to clip curves w.r.t. a border Gerard Hermans Macros/Add-ons 0 09-06-2003 07:50


All times are GMT -5. The time now is 03:15.


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