BUY THIS BOOK
Add to Cart

Print Book $24.95


Add to Cart

PDF $19.99

Safari Books Online

What is this?

Add to UK Cart

Print Book £17.50

What is this?

Looking to Reprint or License this content?


Word Hacks
Word Hacks Tips & Tools for Taming Your Text

By Andrew Savikas
Book Price: $24.95 USD
£17.50 GBP
PDF Price: $19.99

Cover | Table of Contents | Colophon


Table of Contents

Chapter 1: Word Under the Hood
Few consumer software packages are as malleable as Microsoft Word—it has to be malleable, to meet the unique needs of millions of users around the globe. However, many (perhaps most) Word users spend months, or even years, using Word "out of the box," without taking advantage of a single one of its limitless customization tools.
There's a palpable reluctance among long-time Word users to peek behind the curtain. They may curse the wretched Bullets and Numbering buttons 20 times a day or take 2 hours to manually change the font size of every heading in a lengthy report, but they will still not tear off the cover and start tinkering. For too long, they've been seduced by Word's supposed simplicity ("There must be a menu to fix this somewhere...").
If you're one of those users, this chapter will help you find your inner hacker. It asks you to choose the Red Pill and take a trip into Word's inner workings. You will also learn the very basics needed to start really hacking. For everyone else, consider it calisthenics for the rest of the book.
For a more detailed view of Word, check out Word Pocket Guide (O'Reilly). It is an essential reference guide for any Word hacker.
Take charge of toolbars, menus, and screen real estate with a few trips to the Tools menu.
Simple adjustments to the Word environment can save you lots of time. The gateway to tweaking your toolbars and menus is the ToolsCustomize command, which brings up the dialog shown in Figure 1-1. Whenever this dialog is active, your menus and toolbars no longer perform their regular duties—they become adjustable elements of the interface that can be moved, modified, renamed, or even deleted.
Figure 1-1: The Customize dialog lets you quickly customize your workspace
The big kahuna of the Customize dialog is the Commands tab, which we'll explore in the following two sections. But the other two tabs, Options and Toolbars, are also important for understanding—and hacking—Word.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Introduction: Hacks #1-2
Few consumer software packages are as malleable as Microsoft Word—it has to be malleable, to meet the unique needs of millions of users around the globe. However, many (perhaps most) Word users spend months, or even years, using Word "out of the box," without taking advantage of a single one of its limitless customization tools.
There's a palpable reluctance among long-time Word users to peek behind the curtain. They may curse the wretched Bullets and Numbering buttons 20 times a day or take 2 hours to manually change the font size of every heading in a lengthy report, but they will still not tear off the cover and start tinkering. For too long, they've been seduced by Word's supposed simplicity ("There must be a menu to fix this somewhere...").
If you're one of those users, this chapter will help you find your inner hacker. It asks you to choose the Red Pill and take a trip into Word's inner workings. You will also learn the very basics needed to start really hacking. For everyone else, consider it calisthenics for the rest of the book.
For a more detailed view of Word, check out Word Pocket Guide (O'Reilly). It is an essential reference guide for any Word hacker.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Tweak the Interface
Take charge of toolbars, menus, and screen real estate with a few trips to the Tools menu.
Simple adjustments to the Word environment can save you lots of time. The gateway to tweaking your toolbars and menus is the ToolsCustomize command, which brings up the dialog shown in Figure 1-1. Whenever this dialog is active, your menus and toolbars no longer perform their regular duties—they become adjustable elements of the interface that can be moved, modified, renamed, or even deleted.
Figure 1-1: The Customize dialog lets you quickly customize your workspace
The big kahuna of the Customize dialog is the Commands tab, which we'll explore in the following two sections. But the other two tabs, Options and Toolbars, are also important for understanding—and hacking—Word.
Some of Word's more elusive options live on the Options tab, shown in Figure 1-2. For example, you can uncheck the "Always show full menus" box to turn off that unholy "Adaptive Menus" feature that displays only some commands on each menu. You can also tell Word to stop displaying font names in the fonts themselves, which can speed up the display on a slow machine. And the "Show shortcut keys in ScreenTips" setting can help you learn the shortcuts for toolbar buttons you use regularly.
Figure 1-2: The Options tab of the Customize dialog
Use the Toolbars tab to manage your toolbars, reset their default arrangements, or delete custom arrangements you've created but no longer need. You can also create new toolbars and make the Shortcut Menu toolbar [Hack #3] visible for modifying.
Use the Keyboard button (available on all three tabs in the Customize dialog) to add, remove, or modify keyboard assignments.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Macros 101: A Crash Course
This hack offers a whirlwind tour of macros, which can help you automate tedious and time-consuming tasks.
Word 6 or later lets you write, record, and play macros, or short programs that automate tasks in Word. The term macro comes from macrocommand, which originally referred to a bunch of commands strung together and executed all at once. Typically, you would record a sequence of commands, give the sequence a name, and then play it back as needed. You can certainly use Word macros for this purpose, but it represents only the tip of the iceberg.
You create Word macros using Visual Basic for Applications, usually abbreviated as VBA. Even recorded macros get translated into VBA, which you can then examine or edit.
VBA belongs to the BASIC family of computer languages. Compared to other computer languages, such as C or Java, you may find it easier to master. But like any language, you'll need to use it in order to learn it.
A true VBA tutorial falls outside the scope of this book. This hack simply shows you how to create and run a macro like the ones used in this book.
For a thorough guide to Word macros, check out Writing Word Macros (O'Reilly).
Most of the macros in this book, as well as any you record within Word, use the subroutine (Sub) procedure. Each one begins with the following line:
Sub MacroName
            
where MacroName is the name of the macro. Each ends with this line:
End Sub
The instructions you give Word fit between these two lines. Cooking offers a useful analogy. In fact, you can think of a macro as a recipe. You begin with the list of ingredients at the top and then add a sequence of actions to transform those ingredients into something edible. You can even split some recipes into several shorter recipes—i.e., one for the sauce, one for the meat—to make them easier to follow. The same goes for macros. In the example below, note the list of "ingredients" at the top, followed by the rest of the code to work those ingredients into the main course:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 2: The Word Workspace
Word offers an exceptionally hackable environment. Most any menu, toolbar, or viewing option is adjustable. The hacks in this chapter show a few ways to fine-tune your workspace to help you work smarter. In addition, you'll learn a few ways to manage your documents better and how to finally and firmly take control of the much maligned Office Assistant.
To find relevant commands quickly, most Word users head straight for the shortcut menus. But like any Word menu, a shortcut menu is yours for the hacking.
In most applications, you're stuck with whatever the software company decides to put on its shortcut menus (the set of context-sensitive commands that appear when you right-click your mouse). For example, Microsoft must consider hyperlinks [Hack #28] extremely relevant; in Word 2003, you can insert a hyperlink from 26 of the 62 shortcut menus!
The shortcut menu you'll probably use most is the Text shortcut menu, which appears when you right-click within the text of a document. This menu is shown in its native form in Figure 2-1.
Figure 2-1: The default Text shortcut menu
Fortunately, you can rearrange any of the 62 shortcut menus in Word according to your priorities. For example, if you insert a lot of comments, the mouse mileage needed to repeatedly select the text and then go up and choose InsertComment can really add up. This hack will show you how to give your wrist a rest by moving the Insert Comment command closer to where you're working—onto the shortcut menu.
All of the menus in Word reside on toolbars. Even the main menu bar (with File, Edit, View, etc.) is actually a toolbar—appropriately named Menu Bar. Shortcut menus are no different, but the toolbar they live on is a bit harder to find. In fact, except for when you're customizing it, you'll never get to see the Shortcut Menu toolbar; notice it's not one of the choices offered when you select View
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Introduction: Hacks #3-13
Word offers an exceptionally hackable environment. Most any menu, toolbar, or viewing option is adjustable. The hacks in this chapter show a few ways to fine-tune your workspace to help you work smarter. In addition, you'll learn a few ways to manage your documents better and how to finally and firmly take control of the much maligned Office Assistant.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Hack Your Shortcut Menus
To find relevant commands quickly, most Word users head straight for the shortcut menus. But like any Word menu, a shortcut menu is yours for the hacking.
In most applications, you're stuck with whatever the software company decides to put on its shortcut menus (the set of context-sensitive commands that appear when you right-click your mouse). For example, Microsoft must consider hyperlinks [Hack #28] extremely relevant; in Word 2003, you can insert a hyperlink from 26 of the 62 shortcut menus!
The shortcut menu you'll probably use most is the Text shortcut menu, which appears when you right-click within the text of a document. This menu is shown in its native form in Figure 2-1.
Figure 2-1: The default Text shortcut menu
Fortunately, you can rearrange any of the 62 shortcut menus in Word according to your priorities. For example, if you insert a lot of comments, the mouse mileage needed to repeatedly select the text and then go up and choose InsertComment can really add up. This hack will show you how to give your wrist a rest by moving the Insert Comment command closer to where you're working—onto the shortcut menu.
All of the menus in Word reside on toolbars. Even the main menu bar (with File, Edit, View, etc.) is actually a toolbar—appropriately named Menu Bar. Shortcut menus are no different, but the toolbar they live on is a bit harder to find. In fact, except for when you're customizing it, you'll never get to see the Shortcut Menu toolbar; notice it's not one of the choices offered when you select ViewToolbars.
To see the elusive Shortcut Menu toolbar, select ToolsCustomize to display the Customize dialog. You can also right-click on the title bar of any toolbar or an unoccupied area of the main menu bar and choose Customize.
Select the Commands tab. If you want the shortcut menu changes to be available in every document you use, choose
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Create Custom Views
You can easily get a bit disoriented as you change views, toolbars, and zoom levels within Word. This hack shows how to create predefined views and return to them instantly.
Word offers a multitude of viewing options. With the addition of Reading Layout view in Word 2003, you can now choose from six different views: Normal, Web Layout, Print Layout, Reading Layout, Outline, and Print Preview. Plus, you can turn on and off features such as paragraph marks, tabs, hidden text, field codes, and bookmarks, just to name a few. And as Word has more toolbars than you can fit on most screens, depending on the work you're doing you may want to change your view a few dozen times each day.
Even if you only occasionally zoom in or out, or use Reading Layout or an extra toolbar here and there, you've probably found that there are a handful of viewing combinations that you prefer. Unfortunately, reorienting Word the way you want is no small feat. While it may not eat up a whole morning, a few seconds here and there to change a few settings can really add up.
To get the layout just the way you like it in a snap, you can create named sets of viewing options using some VBA code and add them to the View menu for quick toggling.
Say you like to do your editing in Word under the following conditions:
  • Normal view
  • Zoom to 120%
  • Only Standard, Formatting, and Reviewing toolbars visible
  • Field shading, paragraph marks, and hidden text visible
  • Revision tracking turned on
To make this configuration instantly available, put the following macro, named SetEditingView, in the template of your choice [Hack #50] . It sets all the viewing options listed above.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Revert to Saved
Most other word processors and layout programs put a Revert to Saved command right on the File menu. This allows for a quick return to the last saved version of a file. This hack shows you how to add this feature in Word.
While editing a document, you make a mistake. A big mistake. You try the Undo command a few times, but you can't quite retrace your steps. In frustration, you close the document without saving your changes, then reopen it. This is a minor annoyance, but it may be something you have to do a lot. Fortunately, there's an easier way.
To put a Revert to Saved option on your File menu, add this macro to Normal.dot:
Sub FileRevertToSaved( )
Dim sDocPath As String
Dim sDocFullName As String

sDocFullName = ActiveDocument.FullName
sDocPath = ActiveDocument.Path

If Len(sDocPath) = 0 Then
    MsgBox "Can't revert a document that's never been saved."
    Exit Sub
End If

If MsgBox("Really revert to last saved version? " & _
          "(Can't be undone)", _
           vbYesNo) = vbNo Then
   Exit Sub
End If

Documents.Open FileName:=sDocFullName, Revert:=True
End Sub
Select ToolsCustomize and click the Commands tab. Choose Normal.dot from the "Save in" drop-down list. In the Categories list, select Macros, and in the Commands list, select the new FileRevertToSaved macro, as shown in Figure 2-10.
Figure 2-10: Selecting a macro from the Customize dialog
Next, drag the macro to the File menu, as shown in Figure 2-11. After you place it in the menu, you can right-click it and shorten its name to "Revert to Saved." Since you stored this customization in Normal.dot, close and restart Word to prevent losing the change in case of a crash.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Quickly Change Your File Open Path
Instead of always using My Documents, this hack shows you how to make Word open to the folder where your documents really are.
Few Word workers keep all their files in the My Documents folder. Much of the time they're on your desktop or in a different project folder deep on your hard drive. Sometimes they're not even "your" documents; they may live on a server across the office, or across the country. But when you want to get to one of those files, choosing FileOpen always sends you to the same place: the My Documents folder.
Though you can change this default setting—Word will open to the folder of your choosing—it involves a long trip through ToolsOptionsFile LocationsModify. You must then do some more mouse work as you browse for the folder you want to use. Many users give up and resign themselves to starting each workday with a trip through My Documents, but a short macro provides an easier way.
This macro provides an interactive way to change the FileOpen folder to the folder in which the current document resides. Create the following macro, named ReAssignFileOpen, in the template of your choice [Hack #50] :
Sub ReAssignFileOpen( )
Dim sNewPath As String
Dim sCurrentPath As String
Dim sDefaultPath As String
Dim lResponse As Long

sNewPath = ActiveDocument.Path

' Current document must have been saved
' at least once to be in a folder
If Len(sNewPath) = 0 Then
    MsgBox "Please save this document first.", vbExclamation
    Exit Sub
End If

' Capture the default path by temporarily resetting the current one
sCurrentPath = Options.DefaultFilePath(wdDocumentsPath)
Options.DefaultFilePath(wdDocumentsPath) = ""
sDefaultPath = Options.DefaultFilePath(wdDocumentsPath)

' Restore to the current path
Options.DefaultFilePath(wdDocumentsPath) = sCurrentPath

' Prompt user to confirm change to current document's folder
lResponse = MsgBox("Really Change File...Open path to:" & _
            vbCr & vbCr & _
            sNewPath & "?" & _
            vbCr & vbCr & _
            "Press Cancel to reset to Default (" & sDefaultPath & ").", _
            vbYesNoCancel)

' Process response
Select Case lResponse
    Case Is = vbYes
        Options.DefaultFilePath(wdDocumentsPath) = sNewPath
    Case Is = vbNo
        Exit Sub
    Case Is = vbCancel
        Options.DefaultFilePath(wdDocumentsPath) = sDefaultPath
End Select

End Sub
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Report and Review Your Options
A freeware template from MouseTrax displays all of your Word Options settings in a convenient report format.
There are more than 200 settings that qualify as Options in Word 2003 (slightly fewer in earlier versions), and they're often the key to understanding Word's behavior. Sure, you can check most of them by scrounging around the Options dialog (ToolsOptions), but having them all presented for you in a report makes a lot more sense.
A freeware template available from MouseTrax (http://www.MouseTrax.com) generates an easy-to-read Word document listing your current Options settings. Part of the first page of a sample report is shown in Figure 2-14.
Figure 2-14: Review your Options settings in report form
After you download the template for your version of Word, just double-click it to create the report.
If you've set your Macro Security Settings (ToolsMacroSecurity) to High, you'll need to download the template into your templates folder before it will run.
Included with each setting and its current value is a brief description, which can acquaint you with some of Word's more esoteric options (e.g., AllowAccentedUppercase, which has to do with how Word treats accents over capital letters in French).
Greg Chapman
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Force Internet Explorer to Hand Off Word Documents
Trying to edit a Word document from a browser window is like typing with mittens on. This hack shows you how to stop Word documents from opening in Internet Explorer.
When you follow a hyperlink in Internet Explorer that leads to a Word document, the file opens right within the browser window. The resulting combination of toolbars and menus, as shown in Figure 2-15, can make editing a challenge. Some of the Word menus are there, but where are the toolbars? A better way is to leave Internet Explorer out of the equation and force Word documents to open in...well, Word.
Figure 2-15: Editing a Word document from Internet Explorer is no easy feat
Select StartMy Computer. Next, select ToolsFolder Options and click the File Types tab.
Scroll down the list of "Registered file types" and select "DOC Microsoft Word Document," as shown in Figure 2-16.
Figure 2-16: Find the DOC file extension in your list of known file types
Now click the Advanced button at the bottom of the dialog and uncheck the "Browse in same window" box in the resulting Edit File Type dialog, as shown in Figure 2-17.
Figure 2-17: With this setting turned off, Word files opened from Internet Explorer will open in Word
Click the OK button to accept the new setting and close the Folder Options dialog. Now whenever you click on a link that leads to a Word document, the document will open in Word—a simple solution obfuscated by a hard-to-find setting.
You can apply this same technique to other Office files, such as PowerPoint (PPT) or Excel (XLS) documents.
If you need to apply this fix to multiple computers, you can set up a
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Tweak the New Document Task Pane
The jury's still out on the Task Pane introduced in Word 2002, and poor documentation along with bad behavior has only hurt its case. This hack offers some tips on taming the worst offender: the New Document pane.
Many users find the New Document pane a welcome relief from the clutter of the Templates dialog, which is packed with obscure tabs (as shown in Figure 2-18). Others—particularly those who use many different templates—abhor the extra step needed to get to the Templates dialog, now that the Task Pane comes first. But like it or not, you expect the Task Pane to behave as advertised. Yeah, right.
Figure 2-18: The Templates dialog grows more crowded with each release
In a perfect world, you could select ToolsOptions, click the View tab, and uncheck the "Startup Task Pane" box to disable the Task Pane. But for many Word users, this setting has absolutely no effect.
The fix is a registry hack that will put the Task Pane back in its place.
Make sure you set a system restore point before you make any changes to the registry: select StartControl PanelPerformance and MaintenanceSystem Restore (the location of System Restore may vary, depending on how you've configured Windows).
Close Word, select StartRun, and enter regedit to open the registry editor. Navigate to the following key:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General\
Locate the subkey named DoNotDismissFileNewTaskPane and either delete it or set its value to 0.
Close the registry editor and restart Word. The Task Pane will now dutifully obey the checkbox on the View tab.
The New Document Task Pane includes several default options for creating new documents, including access to templates on the Microsoft web site, as shown in Figure 2-19.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Browse All Button Images
When you start adding buttons or menus to a document or template, it would be nice to have more than a few button images to choose from. This hack shows you how to browse all the button images available on your system.
Customized toolbars and menus can be easier to work with when they're labeled with meaningful images. You can modify most toolbar buttons (both custom and built-in) when you open the Customize dialog (select ToolsCustomize). But when you right-click a button and choose Change Button Image, you're presented with a pretty limited selection, as shown in Figure 2-23.
Figure 2-23: The selection of available button images seems quite limited
In addition to this modest assortment, Microsoft Office includes more than 4,000 button images, or faces, that you can use or adapt as needed. Unfortunately, these poorly documented buttons can be difficult to access without using VBA code (and even then, it helps if you know the face ID number of the image).
If you want access to all the options, you can download a freeware add-in from http://www.mvps.org/skp/fidcode.htm that lets you browse all the Office faces, 100 at a time. The FaceID browser, shown in Figure 2-24, displays as a separate toolbar. When you hover your mouse over one of the buttons, the program displays its face ID number as a ToolTip.
Figure 2-24: Browsing available button images with the FaceID browser
Once you find an image you like, you can transfer it from the FaceID browser to a button on your toolbar. For example, let's say you want to put a button for the macro to unlink every hyperlink in a document [Hack #28] right next to the Hyperlink button on the Standard toolbar.
First, put a button for the macro on your toolbar
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Create a Custom Button Image
Customize your controls with any image you can bitmap—even a favorite photo.
Putting a company logo or even a picture onto a toolbar button can give your Word workspace a truly custom look. Turning any graphic into a toolbar button is easier than it sounds.
The image must be a .bmp, .jpg, or .gif file. The optimal dimensions follow:
  • 16 16 pixels
  • 24-bit color depth
Word will scale oversized or not perfectly square images, but you'll be more satisfied with the results if you scale and crop the image yourself.
If you want your image to appear cut out, like most of the Word button images, you'll also need a mask for your image. The mask is a second image that defines the boundaries of the first. To create the mask, blacken the area of the 16x16 square occupied by your image and leave the rest white. The white area of your mask will be filled in by the toolbar color. You can use an image-processing program such as PhotoShop to do this, but many other programs, including SnagIt from TechSmith (http://www.techsmith.com), offer inexpensive image-editing tools.
For example, to create a button image using the animal shown in Figure 2-29, first scale it down to 16 16 pixels and then create a mask, as shown (and magnified considerably) in Figure 2-30.
Figure 2-29: The base image for a new toolbar button
Figure 2-30: The "mask" image for a toolbar button
The following macro creates a new floating toolbar with just one button, containing our sample image. From there, you can use the Copy Button Image and Paste Button Image commands to place the image as needed.
Sub DisplayNewImage( )
Dim cbar As CommandBar
Dim cbarctrl As CommandBarControl
Dim pImage As IPictureDisp
Dim pMask As IPictureDisp
Dim sImageFile as String
Dim sMaskFile as String

sImageFile = "C:\Documents and Settings\My Documents\tarsier.bmp"
sMaskFile = "C:\Documents and Settings\My Documents\mask.bmp"

Set cbar = CommandBars.Add(Name:="My Picture", Position:=msoBarFloating)

Set cbarctrl = cbar.Controls.Add(Type:=msoControlButton)
Set pImage = stdole.StdFunctions.LoadPicture(sImageFile)
Set pMask = stdole.StdFunctions.LoadPicture(sMaskFile)

cbarctrl.Picture = pImage
cbarctrl.Mask = pMask

cbar.visible = True

End Sub
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Hack the Office Assistant
Keep Clippit—Microsoft's annoying computer help character—on a short leash with the techniques shown in this hack.
Ironically, the Office Assistant can be one of the more difficult features to manage in Word. But the Assistant can also be a powerful way to deliver a message to the user of a macro. The following examples take sort of an aikido approach: turning the power of its irritation to a positive end.
Among the more common reactions to the Assistant are requests to get rid of the wretched thing, immediately and permanently. So for many users, including the following line of code in an AutoExec macro [Hack #60] is the quickest way to a Clippit-free life:
Assistant.On = False
You can switch from one Office Assistant character to another even more easily via VBA than via the Office Assistant's interface. To change characters, use the Filename property of the Assistant object:
Assistant.Filename = "OffCat.acs"
The quickest way to run this one-liner is from the Immediate window of the Visual Basic Editor [Hack #2] , as shown in Figure 2-33.
Figure 2-33: Changing the Assistant character from the Immediate window
The available Office Assistant characters depend on your version of Office and the characters installed. Check the C:\Program Files\Microsoft Office\<Version> folder for .acs files (Microsoft Agent Character files). The name of the last folder, <Version>, depends on the version of Office involved—for example, OFFICE11 is typical for Office 2003.
Your selection may vary, but a list of the usual suspects for a typical installation follows:
  • F1.acs
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Build a Better MRU
Summon more than your nine most recently used files at the touch of a button with this hack.
When you work in Word, you often need to access files you were using earlier. To help you, Word provides a list of the most recently used files: the MRU, which appears by default at the bottom of the File menu.
Barring any action on your part, Word automatically adds files to the MRU when you do the following:
  • Open an existing document.
  • Save a file for the first name.
  • Use the Save As command to save a file under a different name.
When you open a file from a macro, you can use the AddToRecentFiles property to prevent Word from adding it to the MRU:
Documents.Open FileName:="Foo.doc",_
    AddToRecentFiles:=False
Generally, the MRU works well for light users of Word. To change the number of entries on the MRU, select ToolsOptions, click the General tab, and adjust the "Recently used file list" setting, as shown in Figure 2-35. Word can remember up to nine of your most recently used files, or you can choose zero to disable the MRU.
Figure 2-35: Changing your MRU settings
If you want to wipe the MRU clean, clear the checkbox, close the Options dialog box, reopen it, and specify how many entries you want for your fresh start. (Remember that other lists, such as the My Recent Documents list in Windows XP and Windows 2000, can still betray your indiscretions.)
You'll confuse the MRU if you delete, move, or rename any of the files it currently lists. Word will suggest you check the file's permissions, make sure you have enough free memory and disk space to open the document, or open the file with the Text Recovery converter. But it will not remove the file from the MRU, as you probably expect (and want).
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 3: Formatting, Printing, and Table Hacks
Word is increasingly being pressed into service as a desktop publishing program, for everything from simple forms and newsletters to custom pieces destined for a professional printing shop. The hacks in this chapter show how to go beyond the basics of several formatting features to make Word a more useful tool for creating high-quality documents.
When designing a template or experimenting with formatting, sometimes you just need text—any text—to play around with.
To quickly and easily fill a paragraph, a page, or an entire document with text, just type the following on a blank line in any open document and press Enter:
=rand( )
By default, you get three paragraphs with four sentences each, as shown in Figure 3-1. The sentence used depends on the language of your version of Word. The English version uses "The quick brown fox jumps over the lazy dog," which happens to use every letter in the alphabet.
Figure 3-1: Word's placeholder text
If you need more or less than the default amount of text, provide numerical values to the rand() function:
=rand(paragraphs, sentences)
Both arguments are optional, but if you want to specify the number of sentences, you must also specify the number of paragraphs.
This little trick works only if you select ToolsAutoCorrect Options, click the AutoCorrect tab, and check the "Replace text as you type" box.
If foxes and dogs aren't for you, you can create your own placeholder text as an AutoText entry.
The template on which you based the current document stores all new AutoText entries. If you did not explicitly choose a template, the Normal template will store the new entry, and it will then be available in all your documents.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Introduction: Hacks #14-26
Word is increasingly being pressed into service as a desktop publishing program, for everything from simple forms and newsletters to custom pieces destined for a professional printing shop. The hacks in this chapter show how to go beyond the basics of several formatting features to make Word a more useful tool for creating high-quality documents.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Insert Placeholder Text
When designing a template or experimenting with formatting, sometimes you just need text—any text—to play around with.
To quickly and easily fill a paragraph, a page, or an entire document with text, just type the following on a blank line in any open document and press Enter:
=rand( )
By default, you get three paragraphs with four sentences each, as shown in Figure 3-1. The sentence used depends on the language of your version of Word. The English version uses "The quick brown fox jumps over the lazy dog," which happens to use every letter in the alphabet.
Figure 3-1: Word's placeholder text
If you need more or less than the default amount of text, provide numerical values to the rand() function:
=rand(paragraphs, sentences)
Both arguments are optional, but if you want to specify the number of sentences, you must also specify the number of paragraphs.
This little trick works only if you select ToolsAutoCorrect Options, click the AutoCorrect tab, and check the "Replace text as you type" box.
If foxes and dogs aren't for you, you can create your own placeholder text as an AutoText entry.
The template on which you based the current document stores all new AutoText entries. If you did not explicitly choose a template, the Normal template will store the new entry, and it will then be available in all your documents.
Type your placeholder text, select it, and choose InsertAutoTextNew. Choose a name for the placeholder text, as shown in Figure 3-2. You should choose a name that you won't likely type for any other reason.
Figure 3-2: Choose a name for your placeholder AutoText entry that won't likely come up elsewhere in a document
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Sample Your System Fonts
Your system probably offers more than 100 fonts. How do you choose the right one? If you rely on simple trial and error, you'll quickly find yourself frustrated. Instead, use this hack to get a sample of every available font.
They say there's no accounting for taste, and that's certainly true about fonts. With hundreds of fonts coming preinstalled on most computers, and thousands more available for purchase online, there's something for everybody.
The tried-and-true method of choosing a font in Word is to select some text and then scroll through the Font pull-down menu on the Formatting toolbar until something strikes your fancy. But when you can see only about a dozen fonts at a time, as in Figure 3-4, it's hard to compare all your options.
Figure 3-4: It's difficult to compare over 100 fonts when you can see only 12 at a time
You can stop Word from displaying your most recently used fonts at the top of the font list. Open up the Windows registry and find the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Office\Version\Word\Options
Add a new String value (EditNew) named NoFontMRUList and give it a value of 1.
Word includes a built-in Font menu, but it's not part of the main menu bar by default. To view it, select ToolsCustomize, click the Commands tab, and select "Built-in Menus" from the Categories list. In the Commands section, select the Font menu and drag it to your main menu bar.
You can scroll through the font menu as described above, but a more efficient, more organized, and more fruitful method of comparing your fonts would be to generate a table of some sample text, formatted in each of the available fonts on your system.
This hack creates a new document containing a two-column table with a row for each available font. The first column lists the font's name, and the second column provides some sample formatted text. The macro sorts the font names alphabetically. A portion of the results is shown in Figure 3-5.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Tab Me to Your Leader
Tables have superseded tab stops, which have largely gone the way of the IBM Selectric typewriter. However, tabs are still the best tool for the job when working with leaders. This hack offers some tips for taming those tabs.
People often use tab leaders to fill the spaces between entry spots on forms filled out by hand, such as job applications or fundraising pledge forms (see Figure 3-7).
Figure 3-7: Underscore leaders used to underline fill-in spots
Many of these forms are created in what can only be called The Hard Way: you type the first entry, then type a series of underscores to the next item, and then fill the rest of the line with underscores. This method will cause trouble for the person responsible for maintaining the form for two reasons:
  • If any text changes, the underscores from one line will either spill over to the next or not match up at the end of the line.
  • Unless you use a constant-width font such as Courier, in which every character is the same width, the ends of each line will rarely line up vertically or extend all the way to the right margin.
But with some planning and the use of one of Word's Drawing features, creating and maintaining forms like this is a breeze.
Because you want each line in the form to use different tab stops, create a separate paragraph in your document for each line. Next, select ViewToolbarsDrawing (the Drawing toolbar may first appear docked to the bottom of your Word window). On the Drawing toolbar, select DrawGrid to display the dialog shown in Figure 3-8. Input 6 pt for horizontal and vertical spacing and then check the "Display gridlines on screen" box.
Figure 3-8:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Make Styles More Manageable with Aliases
Assigning short nicknames to styles can really speed up your formatting time.
To quickly apply a style to selected text, put your cursor in the Styles pull-down menu on the Formatting toolbar, type in the style name, and press Enter.
To instantly move your cursor into the Styles pull-down menu, press Ctrl-Shift-S.
In fact, Word will even attempt to complete the style name as you type, as shown in Figure 3-12. This feature helps if you're applying, say, the Heading 1 style, but it's not much of a shortcut for any of the other heading styles.
Figure 3-12: Word attempts to automatically complete the style's name as you type
You can't rename any of Word's built-in styles, but if you create an alias to a style (such as "h6" for the Heading 6 style), you can type the alias instead of the style's "real" name into the Styles pull-down menu.
To create an alias for a style, select FormatStyles and Formatting, click the desired style, and choose Modify. Put a comma at the end of the style's name, and then put the alias after the comma (don't include a space after the comma, or it will be interpreted as the first character of your alias's name). Figure 3-13 shows you how to create an alias for the Heading 6 style.
Figure 3-13: To create an alias for a style, just put the alias after a comma at the end of the style's name
Now, to apply the Heading 6 style, just enter "h6" in the Styles pull-down menu and press Enter.
Styles can have multiple aliases, but no two styles can have the same alias.
In addition to creating shortcut names for styles, aliases can provide alternate descriptions of a style. For example, if you set up your document to use the Heading 1 style for chapter titles, you might consider adding an alias so the style's called "Heading 1,Chapter."
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Make a Simple Bar Graph
Simple graphics can really spice up a document. This hack shows you how to create a bar graph by fiddling with some table formatting.
Word can't really match a true layout or graphics program like Quark or Freehand for complex layouts and graphics, but you can use more than text and clip art to create visually appealing documents in Word.
For example, say that each month you dutifully put together the company newsletter in Word. Last month, you asked everyone to cast their votes for the name of the company's new softball team (Lions, Tigers, or Bears). You want to publish the results in the newsletter using a simple bar graph like the one shown in Figure 3-15.
Figure 3-15: A simple bar graph, created with a Word table
To create a simple bar graph, you can just hack a well-planned table. Of course, you'll need to do your own math when measuring the individual bars.
To create the bar graph shown in Figure 3-15, first select ToolsOptions, click the General tab, and change your default measurement unit to points. Next, select TableInsert Table and insert a table with two columns and four rows.
With your cursor inside the table, right-click and choose Table Properties. On the Table tab, click the Options button, and change the cell margins to 0 points on all sides.
Now insert the text for the first three rows, putting the percentage in the first column and the team name in the second column. Select the entire last row, right-click, and choose Merge Cells, as shown in Figure 3-16.
Figure 3-16: Merging the cells in the last row
To make the graph accurate, set the widths of each bar proportionate to the percentage of the total that each represents. If you look at the ruler at the top of the page, the right margin just passes the 432-point mark. You can round this number to 400 points and use it as your maximum. In this case, just multiply by four to translate the percentages into point widths. For 10, 30, and 60 percent, you get 40, 120, and 240 points, respectively.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Put Footnotes in Tables
Content preview·Buy PDF of this chapter|