option explicit
private function OpenDialog() as String
dim dlg as object
on error goto OpenDialog_Error
set dlg=CreateObject("MSCOMDlg.Commondialog")
if dlg is nothing then exit sub
dlg.Filter="All Files (*.*)|*.*"
dlg.CancelError=True
dlg.ShowOpen
OpenDialog=dlg.FileName
exit sub
OpenDialog_Error:
end sub
private sub Form_Load()
dim fileName as string
fileName=OpenDialog()
end sub
private function OpenDialog() as String
dim dlg as object
on error goto OpenDialog_Error
set dlg=CreateObject("MSCOMDlg.Commondialog")
if dlg is nothing then exit sub
dlg.Filter="All Files (*.*)|*.*"
dlg.CancelError=True
dlg.ShowOpen
OpenDialog=dlg.FileName
exit sub
OpenDialog_Error:
end sub
private sub Form_Load()
dim fileName as string
fileName=OpenDialog()
end sub
No comments:
Post a Comment