borderAndreaVB free resources for Visual Basic developersborder
AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2017 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 20-04-2015 databse by thenu
icon 07-05-2010 Re: How can print PDF file automatically? by elizas
icon 11-02-2010 Re: version 1.1.2 available for download by admin
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
borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2017 Andrea Tincaniborder