Skip to Content
Access™ 2007 VBA Bible: For Data-Centric Microsoft® Office Applications
book

Access™ 2007 VBA Bible: For Data-Centric Microsoft® Office Applications

by Helen Feddema
May 2007
Intermediate to advanced
720 pages
14h 14m
English
Wiley
Content preview from Access™ 2007 VBA Bible: For Data-Centric Microsoft® Office Applications

Chapter 9. Working with Files and Folders

IN THIS CHAPTER

  • Creating Windows folders

  • Creating FolderPicker and FilePicker dialogs using the Office FileDialog object

  • Writing data to text files using the FileSystemObject, legacy VB statements, and ADO

  • Reading data from text files using the FileSystemObject, legacy VB statements, and ADO

  • Loading files into Attachment fields and saving attachments to files

In the previous chapters I discussed creating Word documents, Excel worksheets, and various types of Outlook items using VBA Automation code. But these aren't the only types of documents you need to work with—sometimes you need to create a plain text document, or import data from one into an Access table. But, before you can work with these documents, you need to work with folders. This chapter covers writing code that works with Windows Explorer folders and text files, using several different methods.

As Access versions have progressed, the available tools for working with files or folders have advanced. In Access 1.0, the notoriously cryptic callback function was the only way to get a list of files to display in a combo box or listbox. By Windows 95, the CommonDialog control was a possibility, at least if you had the Developer edition of Office. But the CommonDialog control was plagued with version problems—if you put one version of it on a form, and sent the database to another person who had a different version of the control, the other person would just get the mysterious message "There ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Microsoft® Office Access 2007 VBA

Microsoft® Office Access 2007 VBA

Scott B. Diamond, Brent Spaulding

Publisher Resources

ISBN: 9780470047026Purchase book