View Single Post
  #6  
Old 28-09-2005, 13:41
twinx
Guest
 
Posts: n/a
Default

Hi,
from germany. I used the script below from pp21, but it does not work. I do not understand the code
In Microsoft Visual Basic I got an error by this line:
Code:
If Right(TargetFolder, 1) <> "\" Then TargetFolder = TargetFolder & "\"
Can somebody help me?
Quote:
Originally Posted by pp21
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
Thanks
Reply With Quote