Private Sub mnuarchivoabrir_Click()
Dim fnum As Integer
dlgOpenFile.Filter = "Text Files (*.lcd)|*.lcd|Text Files (*.txt)|*.txt"
dlgOpenFile.DialogTitle = "Abrir archivo"
dlgOpenFile.Flags = _
cdlOFNFileMustExist + _
cdlOFNHideReadOnly + _
cdlOFNLongNames + _
cdlOFNExplorer
dlgOpenFile.CancelError = True
On Error Resume Next
dlgOpenFile.ShowOpen
If Err.Number = cdlCancel Then
' The user canceled.
Exit Sub
ElseIf Err.Number <> 0 Then
' Unknown error.
MsgBox "Error " & Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If
On Error GoTo 0
' Read the file.
fnum = FreeFile
Open dlgOpenFile.FileName For Input As #fnum
Form1.txtFile.Text = Input$(LOF(fnum), fnum)
Close #fnum
End Sub