borderAndreaVB free resources for Visual Basic developersborder

AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincani
:: Get the full directory path of a file passed in

Author  

Jim Andrews

Language  

VB6

Operating Systems  

Windows 95, 98 and NT
Module

Public Function GetTheFilePath(ByVal strFile) As String
    Files = Split(strFile, "\")
    For I = 0 to (UBound(Files) - 1)
        FilePath = FilePath & Files(I) & "\"
    Next
    GetTheFilePath = FilePath
End Function

Usage

'This is a very simple way to get just the full directory path of
'a file passed in.
'example:
'MyFilePath = GetTheFilePath("C:\testing\jim\file.txt")
'will return "C:\testing\jim\"

:: Navigation

Home

Beginners Corner

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 04-04-2007 error in word VBA to automate creation of mailing labels by dgr7
icon 03-04-2006 Re: installation problem by Goran
icon 03-04-2006 installation problem by vivek_g27
icon 01-11-2005 Re: property page for OCX? by jdsouza
icon 20-05-2005 Re: Copy files by humberto
Partners: Il portale per lui e lei | Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder