Opening Different Types of files using Visual Basic

Sharky Forums


Results 1 to 2 of 2

Thread: Opening Different Types of files using Visual Basic

  1. #1
    Reef Shark
    Join Date
    Oct 2001
    Posts
    252

    Post Opening Different Types of files using Visual Basic

    ...
    Last edited by The Evil Tin Tin; 05-22-2009 at 01:11 PM.

  2. #2
    Hammerhead Shark hobbes2112's Avatar
    Join Date
    Jul 2001
    Posts
    1,553

    Post

    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 a proud member of the SF Linux Hippy Club.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •