View Single Post
  #3  
Old 27-04-2004, 11:23
pp21
Guest
 
Posts: n/a
Default

This macro open all *.cdr in SourceFolred and save them to TargetFolder in CDR 9 format.
Specify source and target folder (both must exist) and run it. You can change output CDR file version.

Code:
Sub SaveOlderVer()
  Dim opt As New StructSaveAsOptions
  
' Specify source and target folder here (both must exist)
  SourceFolder = "C:\cdr_files"
  TargetFolder = "C:\cdr_files\version9"
  
' Specify output CDR version here
  opt.Version = cdrVersion9
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFolder(SourceFolder)
  Set fc = f.Files
  For Each f1 In fc
    If LCase(Right(f1.Name, 4)) = ".cdr" Then
      OpenDocument f1.Path
      If Right(TargetFolder, 1) <> "\" Then TargetFolder = TargetFolder & "\"
      ActiveDocument.SaveAs TargetFolder & f1.Name, opt
      ActiveDocument.Close
    End If
  Next
End Sub

Last edited by Alex; 28-09-2005 at 20:49.
Reply With Quote