Article ID: 198467 - Last Review: October 11, 2006 - Revision: 2.2 ACC2000: How to Automate Importing All Files in a Specific FolderThis article was previously published under Q198467 Moderate: Requires basic macro, coding, and interoperability skills.
SUMMARY
This article shows you how you can automate importing all files of a particular type from a specific folder on your hard disk.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. MORE INFORMATION
The following example runs a procedure from a command button on a form. The
procedure uses an input box to prompt for the folder containing the files that you want to import. Then the code loops through all the files in the folder that you specify and imports them all.
NOTE: The following example imports dBASE version 3.0 files. You select the file type that you want to import by changing the second argument of the TransferDatabase method. If you want to see a list of file types that you can import by using TransferDatabase, create a new macro and insert the TransferDatabase action. Then view the list of file types under the Database Type argument. When you are finished, close the macro without saving it.
REFERENCES
For more information about the TransferDatabase method, in the Visual Basic
Editor, click Microsoft Visual Basic Help on the Help menu, type
"TransferDatabase method" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
| Article Translations
|
Back to the top
