Vernier Luxury Suites: Recording a Macro Carma Lott, the Night Audit Supervisor at Vernier Luxury
Suites, shares a computer with Jenny, the Front Desk
Supervisor. Often, Carma will open Word to find that Jenny has
left all manner of toolbars open in the course of her work.
Carma prefers a "clean" interface and decides to create a macro
that will close all of the toolbars except for the Menu,
Standard, and Formatting toolbars. Assume the role of Carma and
perform the steps that she identifies. - Start a new blank document.
- Use the View menu to open all of the toolbars.
CHOOSE: View, Toolbars, (name of toolbar) Continue until all of the toolbars are open. (The
interface will be extremely cluttered.) - Open the Record Macro dialog box to record a new macro
and enter the following information:
Macro Name: CloseToolbars
Store Macro in: Normal.dot
Description (add the following text to the existing text):
Macro closes all non-default toolbars created by
your name
.
(
Note:
Substitute your name in place of the words "your name.") The
Record Macro dialog box should now appear similar to Figure
11.1.
Figure 11.1 Record Macro dialog box |  (5.0K)
|
- CLICK: Keyboard command button.
- Assign the macro to the Ctrl key+q keyboard
combination.
- Proceed to close all of the open toolbars except for the
Menu, Formatting, and Standard toolbars. Also, be careful not
to accidentally close the Stop Recording toolbar.
- Stop recording the macro.
- Open a few random toolbars and then use the Ctrl key+q
keyboard combination to close them.
- To print the macro code:
CHOOSE: Tools, Macro, Macros SELECT: FlightMemo in the list box CLICK: Edit command button CHOOSE: File, Print CLICK: OK command button - To return to Word:
CHOOSE: File, Close and Return to Microsoft Word. Temporary Solutions: Creating and Editing a Macro
Temporary Solutions has undergone a corporate restructuring
in an attempt to improve public relations. One of the many
changes being made is a new company name, TempSol Staffing.
Cindy Hall, a longtime employee, has been assigned the task of
going through an archive of documents and updating and
reformatting the company brand names. It occurs to her that
this might be a good time to develop a macro to do this work
for her. Assume the role of Cindy and perform the steps that
she identifies. - Open the "wd11xtra01.doc" Word file and save it to your
personal storage location as "TempSol".
- Open the Record Macro dialog box to record a new macro
and enter the following information:
Macro Name: ReplaceName
Store Macro in: Normal.dot
Description (add the following text to the existing text):
Macro updates company name to TempSol Staffing. Macro created
by
your name
.
(
Note:
Substitute your name in place of the words "your
name.") - CLICK: Keyboard command button
- Assign the macro to the Ctrl key+Alt key+q keyboard
combination.
- Record the following steps in the macro:
- CHOOSE: Find, Replace
- TYPE: Temporary Solutions in the Find what text
box
- TYPE: TempSol Staffing in the Replace with text
box
- CLICK: Replace All button
- CLICK: OK to acknowledge the number of replacements
made
- CLICK: CLOSE to close the Replace dialog box
- Stop recording the macro.
- Because Temporary Solutions was often referred to as
"Temp Solutions" in company documents, Cindy is going to edit
the macro to look for this as well. To open the macro for
editing:
CHOOSE: Tools, Macro, Macros SELECT: ReplaceName in the list of macros CLICK: Edit button The Visual Basic Editor will open. - Select the section of code as shown in figure 11.2. Copy
the text by choosing Edit, Copy.
Figure 11.2 Visual Basic Editor |  (5.0K)
|
- Insert a blank line above "End Sub" and paste the code
in.
- In the pasted code, replace the text "Temporary
Solutions" with "Temp Solutions".
- Close the Visual Basic Editor.
- In Word, run the macro and note that it made two
additional replacements.
- Save and close the "TempSol" document.
Jan Dice: Creating a Specialty Toolbar
This exercise practices creating a new toolbar, adding
commands and macros to a toolbar, and reorganizing the
appearance of a toolbar. - Open the "wd11xtra02.doc" Word file and enable macros if
necessary.
- Save the document as "Jans Macros" to your personal
storage location.
- Use the Tools, Customize command to open the customize
dialog box.
- Using the
Toolbars
tab, create a new toolbar named "NewDocs" that will be
stored in the current document.
- Add the following commands to the toolbar:
=0 CELLPADDING=5 WIDTH=302>
| Command | Category | Project.NewMacros.NewFax | Macro | Project.NewMacros.NewMemo | Macro |
- Change the name of the Project.NewMacros.NewFax button to
"Fax".
- Change the name of the Project.NewMacros.NewMemo button
to "Memo".
The toolbar should now appear similar to Figure
11.3.
Figure 11.3 NewDocs toolbar |  (1.0K)
|
- Move the toolbar so that it is docked at the beginning of
the Standard toolbar. The top of the application window
should now appear similar to figure 11.4.
- Save and then close the revised "Jans Macros"
document.
|