In my program I want to make an open dialog box come up when the user clicks on a command button so that they can select a file that will then open.
I was looking at the MSDN documentation and found the following code, but CommonDialog1 isn't declared so it doesn't work (What should I create it as?).
Thanks for any help you can give me.
"Pin me. Perl me."
Regards,
Chris
I was looking at the MSDN documentation and found the following code, but CommonDialog1 isn't declared so it doesn't work (What should I create it as?).
Code:
Private Sub mnuFileOpen_Click ()
' CancelError is True.
On Error GoTo ErrHandler
' Set filters.
CommonDialog1.Filter = "All Files (*.*)|*.*|Text _
Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat"
' Specify default filter.
CommonDialog1.FilterIndex = 2
' 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
Thanks for any help you can give me.
"Pin me. Perl me."
Regards,
Chris