Results 1 to 5 of 5

Thread: [RESOLVED] How to get the filename

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Resolved [RESOLVED] How to get the filename

    I have textbox with file location

    C:\Documents and Settings\fauzul\Desktop\PSM\Final\PNT.TIN.

    How to get the filename only without extension?

    I want to get PNT only

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to get the filename

    Do you want PNT or PNT.TIN?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: How to get the filename

    I want to get "PNT" only.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to get the filename

    Code:
    Private Sub Command1_Click()
    Dim arrFileName() As String
    Dim arrFile() As String
    Dim strFileName As String
    strFileName = "C:\Documents and Settings\fauzul\Desktop\PSM\Final\PNT.TIN"
    arrFileName = Split(strFileName, "\")
    'MsgBox arrFileName(UBound(arrFileName))
    arrFile = Split(arrFileName(UBound(arrFileName)), ".")
    MsgBox arrFile(0)
    End Sub

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: How to get the filename

    It work, Thank you

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