Solved

get just the last part of a file name after the last "\"

Posted on 2014-01-19
7
233 Views
Last Modified: 2014-01-19
FileName with path:
C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle
how can i extract just the 9-spot bet 1.50.cle ?
0
Comment
Question by:isnoend2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39793379
There are a couple of ways but here's one

Dim strParts As String

strParts = Split(?C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

Msgbox strParts(ubound(strParts))
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 39793381
Sorry, change

Dim strParts As String

to

Dim strParts() As String

and

Split(?C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

to

Split("C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

I apologize for the mistakes.
0
 

Author Closing Comment

by:isnoend2001
ID: 39793383
Thanks again.
Learned something unrelated.
seems Thunderbird does not show new mail icon on taskbar if inbox is not open. At least i think is why i am not getting notifications on the task bar
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:isnoend2001
ID: 39793390
Seems vb gives an error
Dim strParts As String
      strParts = Split(myfile, "\")
      Debug.Print strParts(UBound(strParts))<-- expected array
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 39793391
Sorry, can't help you with Thunderbird but once again I'm happy I was able to answer your question.
0
 
LVL 48

Expert Comment

by:Martin Liss
ID: 39793398
Sorry, can't help you with Thunderbird but once again I'm happy I was able to answer your question.
Please see my second post.
0
 

Author Comment

by:isnoend2001
ID: 39793411
gottacha missed the
Dim strParts() As String
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

691 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