Object Model Reference : Classes : C : CorelScriptTools : Methods : CorelScriptTools.Rename |
Function Rename(Src As String, Dst As String, [Overwrite As Long = 1]) As Boolean
Member of CorelScriptTools
The Rename statement changes the name of a file or folder, or can be used to move a file. You cannot move a folder using the Rename statement.
You can also use Rename as a function: it returns True (-1) if the Rename operation is successful or False (0) if is not.
The following VBA example moves the example1.vp file to the Work folder on the D drive.
' statement example |
DIM x AS STRING |
DIM y AS STRING |
x = "C:\work\example1.vp" |
y = "D:\work\example1.vp" |
RENAME x, y, 0 |
The following VBA example renames the example1.cdr file to example2.cdr and assigns -1 to success.
' statement example |
DIM x AS STRING |
DIM y AS STRING |
x = "C:\work\example1.cdr" |
y = "C:\work\example2.cdr" |
success = RENAME (x, y, 0) |
Copyright 2013 Corel Corporation. All rights reserved.