25

Office Files and Folders

Most of the objects discussed in this book come from the Excel Object Model. That is not the only object model available when you are writing Excel VBA code. A number of object models, or type libraries, are automatically associated with each Excel VBA project. You can see them listed in the drop-down menu at the top of the Object Browser or by clicking Tools images References in the VB Editor window and noting the libraries with check marks. There are libraries for Excel, VBA, Office, OLE Automation and, if you attach a UserForm, there will be a Forms library. You can attach more libraries by checking items in the Tools images References dialog box. This process is discussed in later chapters such as Customizing the VBE.

The Office Object Model is made available to all Microsoft Office applications. It contains objects that are used by all Office applications such as CommandBars, which are discussed in Chapter 26. In this chapter, we will examine two objects contained in the Office Object Model that you use to search for, open and save files and the properties associated with them:

  • FileSearch
    • FoundFiles
    • PropertyTests
    • FileTypes
    • SearchScopes
    • ScopeFolders
    • SearchFolders
  • FileDialog
    • FileDialogFilters
    • FileDialogSelectedItems

FileSearch was introduced in Office 97 and ...

Get Excel 2003 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.