Results 1 to 8 of 8

Thread: spaces in filenames!

  1. #1

    Thread Starter
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828

    Exclamation spaces in filenames!

    ok so you can use the CommonDialog to allow the user to select multiple files, and it then seperates each file path with a space in the FileName property.

    but what if some of the filenames themselves have spaces in them!!! it makes it a bit difficult to use the Split function easily then!, any suggestions?
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    You split using Chr(0)
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    VB Code:
    1. Private Sub Form_Load()
    2.     CommonDialog1.Flags = &H200 Or &H80000
    3.     CommonDialog1.ShowOpen
    4.     MsgBox Join(Split(CommonDialog1.FileName, Chr(0)), vbCrLf)
    5. End Sub
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    sorted!

    nice one jamie.

    PS: hope you kick Germany ass today!!!!!
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by darre1
    sorted!

    nice one jamie.

    PS: hope you kick Germany ass today!!!!!
    I'll be watching it on the big screen, with free drinks flowing all day today.
    Goddamn I love corporate events
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6

    Thread Starter
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    corporate event!???
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by darre1
    corporate event!???
    Yeah its a corporate sponsored thing im going to.
    Starting in about an hours time.
    Free food and drink alll day long
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  8. #8

    Thread Starter
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    thats pretty fortunate!!!!

    cocky sod

    i've booked friday off for the england game
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

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