My question is how can I know if the file that I am opening is .txt file or not? Is it possible? Thank you.
You can check the extension of the file after the user picks it:
If (Path.GetExtension(filename).ToLower() = ".txt") Then
' It's a .txt file
End If