Click to See Complete Forum and Search --> : Opening Different Types of files using Visual Basic


The Evil Tin Tin
12-07-2001, 08:47 AM
...

hobbes2112
12-12-2001, 10:25 PM
If you just want to add them to the common dialogue filter, then you just add the entries between pipe symbols...

All one line though:

Form1!CommonDialog.Filter = "Text(*.txt)|*.txt|Word Documents (*.doc)|*.doc|All Files (*.*)|*.*"

Set the Filter index to the one you want to be default when the cdl pops up...
1=.txt
2=.doc
3=.*
in this case

One you have the file name you need to open it using one of the file handling styles...depending on how the file was written this is different.

I suggest you look into the RichTextBox control rather than the simple TextBox.....

It makes it possible to save lots of other things about the text, like font, fontsize, color, underlines, etc...

------------------
Why Yes! I am (http://www.geocities.com/bloodred716/hobbes2112.html) a proud member of the SF Linux Hippy Club (http://www.geocities.com/bloodred716/hippy.html).