#### Find Sub Folder Name within a Folder

Hi
Finding folder extn's is fine but to just find a folder name within a folder
has me beat.
I have a folder named Music this has 900 sub folders by each artists name I
want to check the date modified for each sub folder.
I have looked at findfirst findnext API but not sure how to adapt it to find
sub folder names.
Can you help

 0
Utf
7/12/2010 10:51:26 AM
vb.general.discussion 1016 articles. 0 followers.

5 Replies
1631 Views

Similar Articles

[PageSpeed] 16

On 12/07/2010 11:51, LondonLad wrote:
> Hi
> Finding folder extn's is fine but to just find a folder name within a folder
> has me beat.

Dave O replied to your original question over an hour ago.

--
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.

 0
Dee
7/12/2010 11:13:27 AM
Look, you are going to have to come clean if you want any help - what do you
know so far?

Incidentally, in my previous message I meant "FindFirstFile" &
"FindNextFile", not "FindFirst" & "FindNext" which I think are database
calls.

What is it you don't understand about these APIs, they are painfully easy
and to get all levels of subfolders you just make the routine recursive.

Goggling "VB6 FindFirstFile Recursive" returns 8,222 results, most of which
probably do exactly what I think you want - Does your internet provider
block Google? there really is no other excuse for not going there yourself
to work this out.

We were all beginners at some point, but you really should make some effort
to find out these things for yourself.

Regards
DaveO

> Hi
> Finding folder extn's is fine but to just find a folder name within a
> folder
> has me beat.
> I have a folder named Music this has 900 sub folders by each artists name
> I
> want to check the date modified for each sub folder.
> I have looked at findfirst findnext API but not sure how to adapt it to
> find
> sub folder names.
> Can you help


 0
Dave
7/12/2010 12:28:32 PM
"LondonLad" <LondonLad@discussions.microsoft.com> wrote in message
> Hi
> Finding folder extn's is fine but to just find a folder name within a
> folder
> has me beat.
> I have a folder named Music this has 900 sub folders by each artists name
> I
> want to check the date modified for each sub folder.
> I have looked at findfirst findnext API but not sure how to adapt it to
> find
> sub folder names.

Use InStrRev() to find the last two "\", and extract the subfolder name
using Mid function. Example:

Option Explicit

Dim pos1 As Long
Dim pos2 As Long

pos1 = InStrRev("C:\abc\def\ghi.txt", "\")
Debug.Print pos1
pos2 = InStrRev("C:\abc\def\ghi.txt", "\", pos1 - 1)
Debug.Print pos2
End Sub

Output:

11
7


 0
Nobody
7/12/2010 1:26:16 PM
"Nobody" <nobody@nobody.com> wrote in message
news:i1f55t$u0h$1@speranza.aioe.org...
>> Hi
>> Finding folder extn's is fine but to just find a folder name within a
>> folder
>> has me beat.
>> I have a folder named Music this has 900 sub folders by each artists name
>> I
>> want to check the date modified for each sub folder.
>> I have looked at findfirst findnext API but not sure how to adapt it to
>> find
>> sub folder names.
>
> Use InStrRev() to find the last two "\", and extract the subfolder name
> using Mid function. Example:
>
> Option Explicit
>
>    Dim pos1 As Long
>    Dim pos2 As Long
>
>    pos1 = InStrRev("C:\abc\def\ghi.txt", "\")
>    Debug.Print pos1
>    pos2 = InStrRev("C:\abc\def\ghi.txt", "\", pos1 - 1)
>    Debug.Print pos2
> End Sub
>
> Output:
>
> 11
> 7

Oh, do you think that's what he meant, it is rather hard to tell.
Another way to break the path down is to use Split with the Backslash as the
delimiter - possibly an easier way to manipulate the path although unless
you allow for them, UNC paths can be entertaining when split.

Regards
Dave O.


 0
Dave
7/12/2010 3:18:58 PM
Thanks for theses posts no it was the findfirst findnext that i was looking
for I am quite ok with splitting strings both with split and instrrev.

"Dave O." wrote:

>
> "Nobody" <nobody@nobody.com> wrote in message
> news:i1f55t$u0h$1@speranza.aioe.org...
> >> Hi
> >> Finding folder extn's is fine but to just find a folder name within a
> >> folder
> >> has me beat.
> >> I have a folder named Music this has 900 sub folders by each artists name
> >> I
> >> want to check the date modified for each sub folder.
> >> I have looked at findfirst findnext API but not sure how to adapt it to
> >> find
> >> sub folder names.
> >
> > Use InStrRev() to find the last two "\", and extract the subfolder name
> > using Mid function. Example:
> >
> > Option Explicit
> >
> >    Dim pos1 As Long
> >    Dim pos2 As Long
> >
> >    pos1 = InStrRev("C:\abc\def\ghi.txt", "\")
> >    Debug.Print pos1
> >    pos2 = InStrRev("C:\abc\def\ghi.txt", "\", pos1 - 1)
> >    Debug.Print pos2
> > End Sub
> >
> > Output:
> >
> > 11
> > 7
>
> Oh, do you think that's what he meant, it is rather hard to tell.
> Another way to break the path down is to use Split with the Backslash as the
> delimiter - possibly an easier way to manipulate the path although unless
> you allow for them, UNC paths can be entertaining when split.
>
> Regards
> Dave O.
>
>
> .
>

 0
Utf
7/12/2010 4:49:33 PM

Similar Artilces:

Cannot find the specified Microsoft Exchange Server
This is the error we get upon the final install checklist. ? What can cause this? Our Network Admin is pretty confident that all of his settings are fine. We can see the Exchanger Server in the domain. What are we missing? There are no users set up yet on this test Eschange server, but there is a OU setup on the Domain...but no specific user there either.????? ? If we press ahead with an install, we can add Exchange (and the router) later, correct? yes you do not need to specify an exchange server to complete the install. You can always add it later ============================== Jo...

Finding templates and formats
Can you please tell me, where can I find a template or the format of a resignation letter? With much appreciation. Come on Mary...let's see you find a template for this poster :-D DavidF "mandm" <mandm@discussions.microsoft.com> wrote in message news:724ADDB2-F04E-4AA7-AD35-59BD7CF9ECE7@microsoft.com... > Can you please tell me, where can I find a template or the format of a > resignation letter? With much appreciation. Here's an idea, http://www.azlyrics.com/lyrics/deadkennedys/takethisjobandshoveit.html -- Ron "DavidF" <Nope@nospam.com>...

Finding a mailbox (Connector) ??
Below is a line I took from our Backup Exec server log. "Microsoft Exchange Mailboxes\Internet Mail Service (xxxxxx) [internet mail connector (xxxxxx)]MTS-IN Folder00008" I´ve tried everything to find this particular mailbox but failed. I know this is also our connector to the outside and I checked the physical folders where mail are stored but nothing is there. In the administrator tool I cant find it either in hidden or non hidden boxes wich makes it impossible for me to find the faulty email inside. I cant open it in Outlook either since it cant find that particul...

I have to find the sender's email address
I have to find the sender's email address. But oMsg.SenderName -- > Sender Name returns the name. How can I find the email address? Thanks. oMsg.SenderEmailAddress -- Remember, the object browser (F2 in VBA) is your friend. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "win" <wintelreport@gmail.com> wrote in message news:5992e67c-6655-4638-bf58-6ca1d60a52a4@21g2000yqj.googlegroups.com... >I have to find the sen...

I am using the beta of Microsoft Office 2010 x64. I am trying to write VBA so a user can control messages with attachments, in particular, to be able to select messages or an outlook folder and then specify where to save the attachments. I have managed to put together some code that allows the user to select a folder and place the attachments in a folder I hard code, but I haven't been able to gogure out how to give them a dialog where they can select/create a folder of their choosing. Does such a thing exist in VBA 2010? Using the Object Browser I found a series of methods ...

Compacting Personal Folders File with OL2003
I have worked many years with MS Outlook in various versions starting with Outlook98. My Personal Folders file is now almost 2 Gb in size so I decided to restructure it by creating a new OL2003 type personal folders fileand move a large number of emails into this new archive file. After doing this it has reached a size of 900+ Mb, but the mailbox.pst file has not reduced its size in any noticeable way, maybe 1% or so. So I opened the data file management menu item and selected the old pst file and chose Compact. It starts a dialogue that says "Compacting" with a Cancel button but no...

Adding a Gmail IMAP tag/folder to Entourage
I created a new Gmail tag called travel. In Mail it immediately appears as an IMAP folder. How do I do this in Entourage. I refreshed the message lists etc. On 5/15/10 3:46 PM, in article 9dd4e304-c593-4248-866a-b79e0324ea27@q8g2000vbm.googlegroups.com, "Kerry" <kerry@fastmail.net> wrote: > I created a new Gmail tag called travel. In Mail it immediately > appears as an IMAP folder. How do I do this in Entourage. I refreshed > the message lists etc. Click on the account in the folder list. Select "Receive complete folder list". -- Diane Ros...

Any way to recreate lost System Public Folders
Hi, Is there any way to recreate lost System Public Folders if you don't have available any of their replica??? (EFORMS REGISTRY, Events root, OFFLINE ADDRESS BOOK, SCHEDULE+ FREE BUSY etc) The first Exchange 2000 Server which was installed in the Administrative Group and which was holding the only replica of most of the System Public Folders was crashed and there is no backup to recover from it. I would appreciate anyone's help. Thanks, Soti See the following TechNet article XADM: How to Reset System Folders on an Exchange 2000 Server http://support.microsoft.com/default.aspx?s...

Schema-root public folder -migrating between exchange 2003 servers
Hi I'm migrating from an older 2003 server to a newer one (running concurrently). I read through the microsoft document on removing the first exchange server and setup replica's on the new server. One of the folders is the schema-root. Now I'm seeing two entries for the schema-root on both servers. One is the replicated one from the first server, the other I assume is from the new server. Both are replicated to each server. I'm beginning to think that I shouldn't have replicated the schema-root folder from the first server. Any idea if that is right? If I stop the...

Outlook
We're running Exchange Server 2003/Outlook and running into a problem with Public Folders. When an item is received via an email enabled public folder, there is a delay in that item displaying in Outlook. Sometimes the delay is a few minutes, other times is can be as much as 20 minutes. Interestingly, we have rules enabled on the public folders to notify users when specific items are recieved. These notifactions are sent immediately, yet looking at the public folder, you can not yet 'see' the item. This tells me Exchange has indeed recieved the item, but not yet updated Outloo...

Named sheet to change Cells names
Situation is really tricky for me, (D;E) 4 in one peace, and i need it to be named as my sheet but not fully, Sheet name is T 060_esik (and "esik" part needs transport into cell D;E4) is it possible? I guess i explained correctly! Thnx Let's assume that your sheetname hastwo parts separated by an underscore. The following UDF will return the part following that underscore: Function sname(r As Range) Application.Volatile sname = Split(r.Parent.Name, "_")(1) End Function So if the sheetname is qwerty_asdf =sname(A1) will display: asdf -- Gary''s Student ...

Folders
I have just had my system re-imaged and since that has happened i can only see the new files i saved. i can no longer view the files i created before the re-image. the files are stored on a network drive. can any one tell me why this may be happening I can only guess what happened. It is possible that Excel or any other program for that matter is not pointing to the network drive where your old files are stored. The new files created, might be on your 'C' drive. With Excel running click on Open and in 'Look in' change the drive to the network drive (example; Charl...

HTTP Error when accessing properties of Public Folders
Greetings.... First, thanks for the previous help I have received in this forum. ;) I will try to keep this brief, but afraid it may require more...........Exch2k Server with all service packs up to date. Moving accounts and Public Folder structure from one Exch2k server to another. Will be removing the older of the two from the domain when done. Right-click on the Public Folder to look at the properties of the folder to setup replication of the folder and get the following error message: The HTTP Service used by Public Folders is not available, possible causes are that Public Stor...

Set defaults for new folders
When creating a new folder, two features are set as deafults (among others) that I would like to turn off: Reading Pane ON, and Group Messages by Date Received. Where can I customize the defaults for all new folders? Autstin, Sorry to say, but these items cannot be pre-configured or deployed. Hope this helps. -- Greg Mansius [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights "AustinJerry" <anonymous@discussions.microsoft.com> wrote in message news:3C55712D-328B-4A61-960B-E9D178B9FFC8@microsoft.com... > When creating a new fol...

Total by Name
Hello I am new to using Excel and need help with totalling by name. I am using VB6 to create a spreadsheet. I am sending 3 columns out that I need to total the different names of the people submitting orders. The program will fille the sheet but I need to break the sheet where the names stop. ( If this is making sense ) The sheet will start as this Jeff 8258 01/10/2004 Jeff 9587 01/11/2004 Jeff 9956 01/12/2004 Bill 5478 01/10/2004 Bill 6458 01/11/2004 Bill 7520 01/12/2004 Bill 7912 01/13/2004 Bill 8109 01/14/2004 I would...

passing file name
hye..how to pass the file name that have been read in this function to another function?here's my openfile code.. void CPIDDlg::OnFileOpen() { this->UpdateData(); CFile f; char DataFile[] = { "NUM Files (*.num)|*.num||" }; CFileDialog FileDlg(TRUE,".num",NULL,0,DataFile); if( FileDlg.DoModal() == IDOK) { CString File = FileDlg.GetFileName(); if(f.Open(FileDlg.GetFileName(), CFile::modeRead) == FALSE ) { InitPidDisplay(File); return; } else f.Close(); if (!InitPidDisplay(File)) AfxMessageBox("Failed to load data"); els...

Hi all, I am seeing problems exporting results from Advanced Find to Excel. Sometimes, when the user clicks on the Excel icon, the program just seems to hang at a window showing "project_data.aspx to crm" and the transfer icon (showing files flying across from one folder to another), but the action does not get completed. This appears to be pretty random, it works once, but then not the next time, for the same Saved View. Could this be a Security Role related setting? Or is this related to the server? Does anyone have any suggestions? Thanks in advance. - Smita Thought I'...

Public Folder Items
It appears by default there is no way in a Public accessed through outlook to view the amount of items in the folder such as the way you see in your outlook inbox. I realize you can see the amount of items in Sys Manager or using PFAdmin but is there anyway to view this in outlook for the everyday user, same as outlook inbox..... thanks, KJK In news:9898986D-4A9E-40FA-BCA9-160040629CA9@microsoft.com, KJK <KJK@discussions.microsoft.com> typed: > It appears by default there is no way in a Public accessed through > outlook to view the amount of items in the folder such as th...

Sent mail is not in sent folder
I send a message with attachments, it sends fine. When I go into the Sent folder to view and print a copy of my sent message there is nothing in it. I checked the tools and made sure the box was checked for saving a copy of sent mail. I checked every folder and they are nowhere to be found. While in Sent Items: View | Current View. Is: Show All Messages checked and nothing else? -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "GatewayPA" <GatewayPA@discussions.microsoft.com> wrote in message news:35274335-45C7-4A15-9B1B-B453AD23A...

When searching in Advanced Find for Accounts, we select the field "Hospital Name" which is our primary account and then the Condition "contains" and then the value "North Hospital". We clicked go we had only one record pull up even though there are hundreds of hospitals with North & Hospital in the hospital names. So we tried putting "North * Hospital" in to the value and we got a lot more. Are there additional wildcards or boolean operators and if so where do we find the information? ...

Folders open at oldest email
Several of my subfolders for recieved mail (I filter received mail into specific sub-folders) open up at the oldest message (i.e. bottom of the list) rather than at the last message reviewed or top of the list. How/where is this configured? (Outlook 2003) Thanks ChiefDarkCloud Display reading pane at the bottom, click on the Received column header. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, cal2833@hotmail.com asked: | Se...

public folder issue 2007
Succesfully upgraded to 2007 server, except im having a few issues with some public folders we have a folder with subfolders on the public folder list eg TOPLEVEL -------SUB1 -------SUB2 -------SUB3 -------SUB4 -------SUB5 however since conversion, i'm unable to access some of the subfolders (but only some!) - i get a error message saying "cannot display the folder. this folder cannot be opened because there is a configuration problem on the server. contact your microsoft exchange admin for assistance", I cant even admin the permissions from outlook either ? any ideas ? ...

Outlook and Offline Folders using IMAP #2
I'm running Outlook 2007. It seams to support the IMAP protocol reasonably well. However, I can't figure out how to move messages between folders when I'm offline (it gives an error message saying I can't, see below). This same operation works fine in MS Windows Mail (the equivalent of Outlook Express that ships with Windows Vista) and Mozilla Thunderbird. It's clearly not a limitation of IMAP. I can download messages and read and delete them when I'm offline. I just can't move them between folders unless I'm online. Since Outlook synchronizes any change...

Public Folder Views don't Propagate
This is a repost from the Outlook forums.... Strange problem... Looking for some help. As an Owner of a public folder I create Views for everyone to use. On one Exchange 2000 Server system, we have users who have Outlook 2000, 2002, and 2003. When a new view is created, and a user navigates to the public folder, a new view is seen. If I modify the view after the user has already gone to the Public Folder and seen the folder, the modifications to the view are NOT propagated. I know the Views are invisible messages in a folder, but this is the first Exchange Server that I've seen beha...

Can access it's shared folders, but cannot access the computer directly through network
Need help from all the techies, I have a Windows XP Pro SP2 PC which is made as a server. In the network I have another 5 pc (Windows XP Pro SP2) connected to this server as workstations. From all the workstations, I am *able to open all the shared folders of the server*, but when I tried in the *Run* with *\\server*, I'd get an error saying " *access is denied.* ". I cannot gain access to the server but can open it's shared folders. I have scanned for viruses/spywares/malwares. All cleaned up, but the problem still persists. Can anyone help me? Thank you. ...