CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2001
    Posts
    4

    CommonDialog FileOpen

    I am new to VB and am having a little difficulty with the common dialog File Open control. Basicly I cant open the selected file. I can get the string however I dont seem to be able to connect the string to the Open button on the Control window.
    If I right click on the file and select open the file will open.


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: CommonDialog FileOpen

    The commondialog box doesn't do the opening itself, you will have to do that. The common dialog only supplies a graphical interface. After you pressed the open button, check the filename property of the dialog control. This will contain the file you selected.

    If you right click on a file, it's default popup will show up, and it is explorer that is opening the file, not the commondialog.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Sep 2001
    Posts
    4

    Re: CommonDialog FileOpen

    Thanks for the help.
    I have tried FileOpen, Documents.Open and others.
    I can open a specific document associated with a known application and get the MsgBox but I need a wee bit of code to help me open any file, as one does with explorer.


  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: CommonDialog FileOpen

    read carefully:
    http://www.mvps.org/vbnet/code/shell/shellexecute.htm

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    Sep 2001
    Posts
    4

    Re: CommonDialog FileOpen

    Thanks alot.

    Have fun

    Doug


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured