?
Solved

Display everything after the 2 last backslashes in a filename

Posted on 2007-10-02
3
Medium Priority
?
270 Views
Last Modified: 2010-04-30
Hi Experts
I am trying to setup a recent file list on a menu. I am storing the filename and path in the .tag property.
How can i display just the last folder the filename not the full path? like this:
The full path: C::\Program Files\Calculator\June bids\John Doe, 11125 oak Ave.bid
I want to display this: June bids\John Doe, 11125 oak Ave.bid everything after the last 2 backslashes.




0
Comment
Question by:isnoend2001
  • 2
3 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 20003190
Hello isnoend2001,

Dim arr As Variant
arr = Split(PathVariable, "\")
Debug.Print arr(UBound(arr) - 1) & "\" & arr(UBound(arr))

Regards,

Patrick
0
 
LVL 8

Expert Comment

by:MrRobot
ID: 20003208
dim p() as String

p = split(myPathAndFileName,"\")

debug.Print p(ubound(p-1) & "\" & p(ubound(p))
0
 
LVL 8

Expert Comment

by:MrRobot
ID: 20003213
ubound(p)-1 , even =)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

809 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