- Recovering More of Your Work with a Shorter AutoRecover Interval
- Automatically Saving Your Work Frequently
- Closing a Document Without Saving
- Closing All Your Open Documents
- Making Backups as You Work
- Showing More Items on the Recent Documents List
- Opening the Most Recently Used Document at Startup
- Clearing the Recent Documents List
- Creating and Opening Document Workspaces
- Automatically Prompting for Document Properties
- Creating a Trusted Location for Documents
- Viewing Total Editing Time Updated in Real-Time
- Calculating Billable Time Charges
- Locking Document Formatting
- Preventing Untracked Changes
- Setting Up a Document for Structured Editing
- Inspecting a Document for Personal Information
- Viewing Two Documents Side by Side
- Updating All Fields Automatically
Closing All Your Open Documents
Later in this chapter, you learn how to create workspaces—collections of Word documents that you open as a unit. Before you open a workspace, it's a good idea to close all your open documents. You might also want to close all your open documents to get a fresh start with Word. In previous versions of Word, you can do this by holding down the Shift key, pulling down the File menu, and then selecting the Close All command. Unfortunately, that trick does not work in Word 2007. The other alternative is to shut down and restart Word, but that's often time-consuming. A faster method is to use the macro in Listing 3.4.
Listing 3.4. A Macro That Closes All Open Documents
Sub CloseAllOpenDocuments() Dim doc As Document For Each doc In Documents doc.Close Next 'doc End Sub
This macro runs through the Document objects that are in the Documents collection, which holds all the documents that are currently open in Word. For each document, the macro runs the Close method without any arguments, which means that Word will prompt you to save changes.