Chapter 4

Creating and Managing Files and Documents

Before you can insert or manipulate content in applications like Word, Excel, PowerPoint, or Microsoft Access, you need to create a new document or open an existing one. When you've finished inserting and manipulating content, you need to determine where the document is going to reside. Before saving a document, you might want to add properties that distinguish it from others or help categorize it in a set of documents. A server, for example, may have a document library that organizes information about documents, manages them, and provides functionality such as version control and backup facilities.

The functionality provided by the commands on the File menus in Word, Excel, PowerPoint, and Access help you create and manage documents. The File menu is used to create new documents and open existing ones; to save, close, and print documents; and to set document properties. This chapter describes the programmatic equivalents of the following commands: New, Open, Close, Save, Save As, Save as Web Page, Print, and Properties.

This chapter also discusses the programmatic equivalents of locating where a document is situated or finding a folder to store a document—similar to the functionality provided by the New, Open, and Save As dialog boxes. The next chapter, "Managing Documents With Events," describes how to set up event procedures that are triggered when the actions new, open, save, close, and print occur either through Microsoft Visual Basic code or from the user clicking a File menu command.

The code you use to locate, create, remove, and copy file folders, as well as to parse filenames, involves a number of different functions. The following section describes them.