I'm not sure what you mean, but here's the routine that I use:
VB Code:
Private Sub cmdOpen_Click()
' CancelError is True.
On Error GoTo ErrHandler
' Set Flags
CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames
' Set filters.
CommonDialog1.Filter = "All Files (*.*)|*.*|Text" & _
"Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat"
' Specify default filter.
CommonDialog1.FilterIndex = 2 ' Picks TEXT as default
' Display the Open dialog box.
CommonDialog1.ShowOpen
' Call the open file procedure.
' OpenFile (CommonDialog1.FileName)
Exit Sub
ErrHandler:
' User pressed Cancel button.
Exit Sub
End Sub
Filename returns this, you'd have to split() on the space between names.
D:\VISUAL~2\C\CDCSHO~1\ CDCSHO~1.ZIP form1.frm form1.frx Project1.vbp Project1.vbw