Name Statement

Renomea un ficheiro ou cartafol existente.

Sintaxe:


Name NomeAntigo As String As NomeNovo As String

Parámetros:

OldName, NewName: Any string expression that specifies the file name, including the path. You can also use URL notation.

Exemplo:


Sub ExampleReName
On Error GoTo Error
FileCopy "c:\autoexec.bat", "c:\temp\autoexec.sav"
Name "c:\temp\autoexec.sav" As "c:\temp\autoexec.bat"
End
Error:
If err = 58 Then
    msgbox "O ficheiro xa existe"
End If
End
End Sub

Axúdenos, por favor!