
the common dialog box (open/save mode)
SitePath = fncOpenFile("Text(*.TXT)|*.TXT")
Public Function fncOpenFile(ByVal FileType As String) As Variant
On Error GoTo ErrorHandle
' Set CancelError is True
CommonDialog1.CancelError = True ' Set flags
CommonDialog1.FLAGS = cdlOFNHideReadOnly
' Set filters
CommonDialog1.Filter = FileType
' Specify default filter
CommonDialog1.FilterIndex = 2
' Display the Open dialog box
CommonDialog1.ShowOpen
' Display name of selected file
fncOpenFile = CommonDialog1.FileName
errorHandle:
'Do your errorhandle
End Function
Quote:
> 1) is there any way of getting the common dialog to return a directory
> (not just a file name)?
> 2) If the above is possible as an extension can it return a mixture of
> both directories and files (using multi-select)?
> if one or both of the above are not possible is there another simple
> way of achieving the same results?
> any help would be much appreciated! and thanks in advance
> Sent via Deja.com
> http://www.deja.com/