Obtain a list of all files in one sub-directory with VBA?

Is it possible to obtain a list of all files in one sub-directory with Access 
2007 VBA code? 
 
Brad
0
Utf
4/17/2010 10:44:01 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

2 Replies
4149 Views

Similar Articles

[PageSpeed] 8

"Brad" <Brad@discussions.microsoft.com> wrote in message 
news:833ACDD1-E21F-4CDC-B8A3-5A68CE70B853@microsoft.com...
> Is it possible to obtain a list of all files in one sub-directory with 
> Access
> 2007 VBA code?
>
> Brad

Dim fdr As String

fdr = Dir("c:\temp\*.*")
Do While fdr <> ""
    debug.Print fdr
    fdr = Dir
Loop

This will output all the file names contained in c:\temp to the debug 
window.


0
Stuart
4/18/2010 2:26:20 AM
Stuart,

Thanks for the help, I really appreciate it.
 
Brad



"Stuart McCall" wrote:

> "Brad" <Brad@discussions.microsoft.com> wrote in message 
> news:833ACDD1-E21F-4CDC-B8A3-5A68CE70B853@microsoft.com...
> > Is it possible to obtain a list of all files in one sub-directory with 
> > Access
> > 2007 VBA code?
> >
> > Brad
> 
> Dim fdr As String
> 
> fdr = Dir("c:\temp\*.*")
> Do While fdr <> ""
>     debug.Print fdr
>     fdr = Dir
> Loop
> 
> This will output all the file names contained in c:\temp to the debug 
> window.
> 
> 
> .
> 
0
Utf
4/18/2010 12:15:01 PM
Reply:

Similar Artilces:

Restore file corruupt
We had a major computer problem and ended up restoring our computer from the restore disks. Before we crashed I had backed up my money files to a disk. When I try to restore my money backup I get the message that the file is corrutped or is not a money file is there anyway to restore this file or do I have to start over and re-enter 3 years worth of transactions? Try copying the files from the disk to the harddrive and try restoring from there. "Troy" <mcmac@conpoint.com> wrote in message news:049a01c37fd1$23081310$a101280a@phx.gbl... > We had a major computer probl...

please disregard hard to explain in one line, I found it on page 8
Mike Stewart wrote: <nothing> Page 8 of WHAT? Hi page 83 of this thread. Thanks Mike "Gordon" wrote: > Mike Stewart wrote: > <nothing> > > Page 8 of WHAT? > ...

Outlook says I need a password to access files?
I just bought Microsoft Office 2003 and when I try to pull up Outlook it says I need a password before I can even see anything! I have never used it before, but this was my father's computer but he said he never had a password on any files! It will not let me in! Help! What is the exact message, not paraphrased? --=81 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. =20 After furious head scratching, Courtney N. asked: | I just bought Microsoft Office 2003 an...

Drop down Cat list gone in '06?
I just noticed that when I went to view a category or payee on the main cat/payee pages that the drop down box is gone. Anyway to fix it? Go to tools->settings->Category settings, and there is an option to use the dual category dropdown control, which will restore it for you. -- Glyn Simpson, Microsoft MVP - Money http://money.mvps.org Check http://money.mvps.org/faq for tips and fixes for MS Money. To send Microsoft your product wishes see http://money.mvps.org/wishes.aspx I do not respond to any unsolicited email regarding Money "Andrew" <noemail@noemail.com>...

Ten calendar harm one of the products
Ten calendar harm one of the products www.laptop-battery-inc.co.uk/spy-pen.htm ...

Exchange Address Lists #2
I would like to restrict access to the GAL so that only certain users can access it. Then create department-specific address lists for certain departments. What is the proper way to do this? Is it a bad idea to change the permissions on the GAL? Also, the Exchange organization is still in mixed mode due to an old Exchange 5.5 server (with no user mailboxes) that we have not gotten clearance to remove yet. Thank you in advance for any help, On Mon, 12 Feb 2007 11:40:32 -0500, "Dan DeStefano" <dan.destefanoATinfo-lutionDOTcom> wrote: >I would like to restrict ac...

Help Creating Lists
Is there a way to create a column of dates in the format of Jan 02, Fe 02, etc through Dec 06 without having to type all that?: -- Message posted from http://www.ExcelForum.com Format the column as mmm yy. In A1, put =Date(2002,ROW(),1) drag-copy the formula down to A60 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "ams228 >" <<ams228.163xjo@excelforum-nospam.com> wrote in message news:ams228.163xjo@excelforum-nospam.com... > Is there a way to create a column of dates in ...

Obtaining CWnd
I using a function to get information about the current DC. In this case, I want to grab the current DC and save it off so that I might modify it to retrieve information about a particular font. CClientDC wants a CWnd *. Previously, I would save a ptr to the main application window but I'm trying to provide a better encapsulation so I don't have to rely on an external ptr of sorts. Is there an API call that will allow me to get the pointer to the main application (process)? This is a scaled down implementation of the function - CSize DisplayHandler::TextDimension(const TCHAR *T...

How can I save a data file in Access?
I have to format and reinstall XP and other programs in my Aunt's computer and she has an address list saved in Access and I haven't worked with that program. How can I save that list and put it back where it was after I reinstall the OS? Tahnks...... JCW "JCW" <jcw@nowhere.net> wrote in message news:eROEitBiHHA.596@TK2MSFTNGP06.phx.gbl... > I have to format and reinstall XP and other programs in my Aunt's computer > and she has an address list saved in Access and I haven't worked with that > program. How can I save that list and put it back whe...

file money 2000
Hallo... is possible read a file .mny ( money2000) and inport it in a new version (2007 or.....other) tks.... In microsoft.public.money, grogh wrote: >Hallo... >is possible read a file .mny ( money2000) and inport it in a new version >(2007 or.....other) If it were a US, yes. Not for an Italian version. ...

line chart problem when I open file in 2007
Hi! I have a problem with a line chart I made in Excel 2003 it is a line chart that shows selling numbers during a year. On the x-axis I show the last day of every month. The base unit is days and the main unit is month. my min value is 2006-01-31 and maxvalu is 2006-12-31. It works fine in 2003. The problem is when I open the file in excel 2007 then the x-axis shows the dates 2006-01-31 2006-03-03 2006-04-03 2006-05-03 and so on showint the third of every month except for januari. It shows it right if I instead show the first of every month, the problem is that I have made this graphs f...

Open third-party form with VBA
Is it possible to use VBA to open a third-party form from a GP form? My specific example is I want to open a vendor cost inquiry screen that's in the Myridas dictionaries using a button on the GP Item Price List Maintenance screen. Is this possible? GP 9. Thanks in advance. -Joe Yes, it is possible. Add a reference to the Myridas project in your Dynamics GP project in VBA. Take a look at my 3-day VBA Workshop at http://dynamicsgpblogster.blogspot.com/2009/02/this-week-free-visual-basic-for.html for the technique I used. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Glo...

KPI list
Hi, I created a KPI list based on a task list, where I added a "completed on" column in order to compare with "due date" column. How should I tell the KPI list to produce the percentage of those tasks where task "compelted on" column is equal or less than "due date"? In order to do this computation you have to know two numbers: Number of tasks done on time Number of tasks not done on time Both these numbers would be an aggregation of the entire list. SharePoint does not provide, out of the box, this sort of aggregate comput...

Copying input in textbox vba to excel
Dear helpful souls, I'm need your help on these please. I'm trying to create a textbox control in powerpoint slide. I'm hoping that the text that I input in the textbox can be captured in the excel column 3, rows 2-20 for example. This are used for to record the index number and age. Thanks alot in advance friends ...

Setting Recipient Limits On Exchange 2003 & Group Lists
I am trying to set a limit to the number of recipients that can be included in an email address field. I thought I saw some place where the Recipeint Limit set under Message Delivery, Global Settings counted each Exchange group as a single recipient regardless of the number of members in the list. However, the total number of members in personal distribution lists created in Outlook was used. This does not seem to be the way it's working. I have limited permissions to send to our various corporate distribution lists, or groups, and set a Message Delivery Recipient Limit less tha...

911
Is there any way to move email from one queue to another? We journal all our email to a mailbox on a dedicated Exchange Server - all it has on it is the journal mailbox. Unfortunately, that server crashed today and there are about 10K email sitting in queues for that server. I've rebuilt a new Exchange Server and have journaling working again but the mail backing up in the queues is eventually going to time out and start sending delay and undeliverables back to the sender. The only thing I can think of is to go into the queue folder in Windows Explorer and drag the emails into O...

create a separate list for unique records
I have a column of data with records may duplicate, how can i create a separate list in other area of the worksheet for unique records only, is it possible to do this without macro. Thanks a lot -- eva cheng Use Data>Filter>Advanced Filter, it has a unique records option. -- HTH Bob "eva cheng" <evacheng@discussions.microsoft.com> wrote in message news:A7A58A2C-E566-46A3-8960-E13D661B0E7B@microsoft.com... >I have a column of data with records may duplicate, how can i create a > separate list in other area of the worksheet for unique reco...

Problems in the string articlexml obtained
string strColumnSetXml = "<columnset>"; strColumnSetXml += "<column>title</column>"; strColumnSetXml += "<column>description</column>"; strColumnSetXml += "<column>number</column>"; strColumnSetXml += "<column>articlexml</column>"; strColumnSetXml += "<column>modifiedon</column>"; strColumnSetXml += "</columnset>"; // Retrieve the article return article.Retrieve(userAuth, articleId, strColumnSetXml); When i execute the code above, in the column xml i o...

Delegate editing the Global Address List
All, I've read a few posts that have "stepped around" this issue, but I would like to see what other opinions there. We are running Win2000 AD w/Exch 2003 server. In AD, all depts. are broke out into OUs. We would like to delegate 1 person per dept. (OU) to edit phone, address, office, etc... for all other people in X OU. We would prefer that this be done through the Exch. Global Address List. How? T Please remember, in Exhange 200x, the GAL is an extension of Active Directory. AD is the repository for all the attributes on the user objects and the information in the GAL...

password vba
Hi, Is there a way to password the vba modules in an excel worksheet so that unauthorised people can't change it? Thanks To protect the VBA project, from your workbook right-click the workbook's icon and pick View Code. This icon is to the left of the "File" menu this will open the VBA editor, in the left hand window right click on your workbook name and select VBA project properties, protection, check lock project for viewing and set a password. Press Alt and Q to close this window and go back to your workbook and save and close the file -- Paul B Always backup your dat...

How does PST files increase
If you have a pst file that you put 20 messages into everyday, but delete messages from that folder that are older than 1 month. will the pst file size grow more and more, or will the new incoming mail items use the "free" space that the mail that was deleted from the folder used? It should use the available 'whitespace'. Make sure you keep an eye on the file size (esp if using OL2002 and prior - 2GB limit, but problems usually occur earlier) and compact the file periodically. andre wrote: > If you have a pst file that you put 20 messages into > everyday, but dele...

backup ISP with one exchange server
we have one exchange 2003 server and we use a External ISP T1 connection and the ISP DNS which has the MX record. 10 email.domain.org (First ISP IP address for the email server) 20 email2.domain.org (second ISP IP address for the email server) We have a backup ISP connection that stays idle. when we switch over to the backup ISP connection (because the first is down) we cannot get the incoming email in. Outgoing works fine. How can we get the incoming email to route to the one exchange server with either ISP? On 18 Jan 2007 18:06:16 -0800, "zakmanx" <lskw360@sbcglobal.net&g...

Marketing Lists, Exporting Marketing List Members to Excel
Hi all, I hope that somebody can help me out here. We've just discovered what we think is a bug with the exports to Excel. When we try to export the all of the members of a Marketing List (16320 in total), only 3000 are exported in Excel. The web server is setup to allow 30 000 lines per Excel export, and when we modify that to 40 000 and try to export the members we get 4000 lines... From that test it looks like there's a bug that reduces the Excel export to 10% of the number of Marketing List Members. If I use the Manage Members function and an Advanced Find I can get almost ...

CRM data migration problem (from excel or text files to cdf_mscrm database)
Bonjour all, I'm sure you must have experience in importing the data to MS CRM cdf_mscrm database using the DTS utility in SQL server... Would you mind share with me and guide me how to do it? I read a book and it sounds easy. Moreover, I can successfully import data from a text or excel files into the SQL server sample database. However, I encounterd a problem when using the DTS service in MS SQL to migration data into the MS CRM data migration framework database (cdf_mscrm database). All data are in either excel files or text files. Error messages received when importing the dat...

Cannot open file
I was working on an 8 page document in Publisher 2003 and I tried to change from 1 page view to 2 page view. The computer then said it was short of virtual memory and closed publisher. Now I cannot open the file. File size is about 14Mb Any help would be gratefully appreciated - don't want to start again. ...