You've got a couple things going on here. For one, it looks like you're expecting to receive a file name from this:
You really recieve a DialogResult, which VB is automatically turning into a string and putting in your Fn variable. Run this code and you'll see what I mean:VB Code:
Fn = OFD2.ShowDialog() ' show the Open dialog
Notice the result if you click ok or cancel.VB Code:
Dim myString As String myString = OpenFileDialog1.ShowDialog() MessageBox.Show(myString)
If you want the file name choosen, use
VB Code:
MessageBox.Show(OpenFileDialog1.FileName)
I guess the second problem is this?
VB Code:
If Fn <> "" Then ' if it doesn't equel nothing then open file, also no workie ' OFD2.OpenFile() ' No workie End If
I assume you realize that your OpenFile method is commented out. Calling OpenFile will return a stream. Is that what you mean to do? Or do you wish to "open" the file, like in a text editor or some other app?




Reply With Quote