almubarmeg
05-10-2003, 12:07 PM
Dear friends,
1-What is the problem with this "Open window code"
Private Sub lbopen_Click()
cmdlb.Enabled = True
With dlgCommonDialog
.DialogTitle = "Open"
.CancelError = False
.Filter = " (*.txt)|*.txt"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
ofile = .FileName
On Error GoTo Errorhandle
Open ofile For Input As #1
Print "File path ", ofile
ok:
Exit Sub
Errorhandle:
MsgBox " The file is already open "
Resume ok
End With
The problem is the code can't check if the file has been opened or not..why ?
2- how can i write a code for save window
any help ?
1-What is the problem with this "Open window code"
Private Sub lbopen_Click()
cmdlb.Enabled = True
With dlgCommonDialog
.DialogTitle = "Open"
.CancelError = False
.Filter = " (*.txt)|*.txt"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
ofile = .FileName
On Error GoTo Errorhandle
Open ofile For Input As #1
Print "File path ", ofile
ok:
Exit Sub
Errorhandle:
MsgBox " The file is already open "
Resume ok
End With
The problem is the code can't check if the file has been opened or not..why ?
2- how can i write a code for save window
any help ?