I am attempting to add my own extension to a filename.
This doesn’t work.
Dim dlg as SaveFileDialog
Dim SelectedFileName as FolderItem
// other code
SelectedFileName=dlg.ShowModal()
strTemp = SelectedFileName.Name
StrTemp = strTemp + “.RPL”
SelectedFileName.Name = strTemp
This is not the right way to handle extensions + the save dialog. The system will give you the filename with or without the extension as desired by the user. The correct way would be to set up a filter for the save dialog featuring your extension. This will pass you an appropriately named FolderItem.
As an illustrative example, and written in the forum post editor so you may need to tweak
[code]dim tftRPL as new FileType
tftRPL.Extensions = “.rpl”
tftRPL.Name = “RPL”
dim tsd as new SaveFileDialog
tsd.Filter = tftRPL
dim tfSelected as FolderItem = tsd.ShowModal
[/code]
tfSelected will have or not have the extension based on the user setting. This is the way saving works so fighting against it will make your app stand out as misbehaving.