API Documentation > CorelDRAW > 2025-v26 > CorelScriptTools > ICorelScriptTools
CorelScriptTools.Rename method
Rename
Syntax:
Function Rename(ByVal src As String, ByVal Dst As String, Optional ByVal Overwrite As Long = 1) As Boolean
Parameters:
Name Type Description
src
String
Dst
String
Overwrite
Long
If file_folder2 already exists, determines whether to overwrite the existing file (you cannot overwrite existing folders): 0 = rename and overwrite 1 = overwrite fails (default if omitted)
Remarks:
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.
Examples:
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)