Here is the code which is being used to open a file and then process words,
characters, etc. What I want to do is filter the file types so that only
text files can be opened.
Private Sub btnAnalyzeFile_ Click(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnAnalyzeFile. Click
Me.txtBoxInput. Clear()
Dim Open As New OpenFileDialog
Dim Obj As New Unit5ClassLibra ry.StringProces sor.StringProce ssor
Try
If Open.ShowDialog () = DialogResult.OK Then
Obj.Openfile(Op en.FileName)
Me.txtBoxCharac ters.Text = Obj.characters
Me.txtBoxWords. Text = Obj.words
Me.txtBoxSenten ce.Text = Obj.sentences
Me.txtBoxParagr aph.Text = Obj.paragraphs
End If
Catch er As Exception
MsgBox(er.Messa ge)
Finally
End Try
End Sub
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:e$******** ******@TK2MSFTN GP05.phx.gbl...
"Charlie Brookhart" <ch************ ****@hotmail.co m> schrieb:I have created a program that opens a file and counts words, characters,
sentences, etc. I have not used the open file dialog control found in
the VB
.NET 2003 toolbox. I instead have used Open.ShowDialog (). What I want to
do
is filter the open file so that only text files (*.txt) can be opened.
OpenFileDialog has a 'Filter' property...
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>