[RESOLVED] don't want extension common dialog
I use common dialog. I set filter to this extension *.shp. I don't want include the extension to display the filename. I just want file1 only not file1.shp
Code:
CommonDialog1.Filter = "ESRI Shapefiles (*.shp)|*.shp"
CommonDialog1.CancelError = True
CommonDialog1.InitDir = App.path
CommonDialog1.DefaultExt = ".shp"
CommonDialog1.ShowOpen
CommonDialog1.DialogTitle = "Add data"
sfname = CommonDialog1.FileTitle
path = Left(CommonDialog1.FileName, _
Len(CommonDialog1.FileName) - _
Len(CommonDialog1.FileTitle))
Re: don't want extension common dialog
Just use the fileTitle property and mid$ function to chop off the extension.
Code:
path = Mid$(CommonDialog1.FileTitle, 1, InStr(1, CommonDialog1.FileTitle, ".") - 1)
Re: don't want extension common dialog
Quote:
don't want include the extension to display the filename
in the File Name textbox of dialog? It is not by default displayed!
Re: [RESOLVED] don't want extension common dialog
That depends on the setting in Windows Explorer (Tools/Folder Options/View/Hide extensions for known file types), not in anything in CommonDialog settings.