Xojo.IO.FolderItem.Name

From Xojo Documentation

Property (As Text )
aXojo.IO.FolderItem.Name = newTextValue
or
TextValue = aXojo.IO.FolderItem.Name

Supported for all project types and targets.

The name of the FolderItem. Changing this name renames the file or folder.

Exceptions

  • RuntimeException for these conditions:
    • User does not have permissions to rename the FolderItem
    • The FolderItem is in use
    • The name already exists

Sample Code

Renames a file:

Dim f As FolderItem = SpecialFolder.Documents("MyFile.txt")
f.Name = "NewFile.txt" ' renames file