✔ 最佳答案
Private Sub Form_Activate()
cdlCommon.CancelError =True
cdlCommon.Flags = cdlOFNHideReadOnly ' Hides read only files
cdlCommon.Filter = "All Files (*.*)|*.*|Text Files" & _
"(*.txt)|*.txt|Gatch Files (*.bat)|*.bat|"
' Specify default filter
cdlCommon.FilterIndex = 2
cdlCommon.ShowOpen
End Sub
you can change the 'txt' or 'bat' according what format of file you wanna open.
and note that u need to click on Projects, Components and scroll to the Microsoft Common Dialog Control 6.0. Place a check mark next to the control, click Apply and OK
Also, it's not a 'form' actually, but it's called a dialog box.