Solved

Question with App.path ( Visual Basic 6 and 500 Points )

Posted on 2009-04-06
1
454 Views
Last Modified: 2012-05-06
I am using app.path to get the dir of my application. Everything is ok however i am interest to get a part of the app.path. For example my app.path is "c:\project\code" , how can i get only "c:\project" ?
0
Comment
Question by:KingSencat
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 24078393
This function should do it.
Function GetLeftPath() As String

    Dim Parts() As String

    

    Parts = Split(App.Path, "\")

    ReDim Preserve Parts(UBound(Parts) - 1)

    GetLeftPath = Join(Parts, "\")

End Function

Open in new window

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now