Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function similar to VFP getfile()
Message
From
17/04/2003 00:07:20
 
 
To
16/04/2003 22:06:24
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00778692
Message ID:
00778709
Views:
21
There is a control called CommonDialog, you need to drop it on the form and then you can do something like this:

Dim strFilename As String
' Set CancelError is True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' Set flags
CommonDialog1.Flags = cdlOFNHideReadOnly
' 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
strFilename = CommonDialog1.FileName
Exit Sub

ErrHandler:
'User pressed the Cancel button
End Sub

Roman

>Hello
>
>in VB6, is there a function similar to VFP Getfile() function.
>
>Basicly, I want the user to select a file and capture the file name and path.
>
>Thanks
Roman Rehak, MCSD, MCDBA, MCSA
Competitive Computing
354 Mountain View Drive
Colchester, VT 05446-5824
802-764-1729
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform