McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Center | Instructor Center | Information Center | Home
Glossary
Data Files
Buzz in IT
Learning Objectives
Chapter Outline
Prerequisites
Multiple Choice Quiz
Short Answer
True or False
Case Problems
Hands-On Exercises
Feedback
Help Center


Advantage Series: Microsoft Word 2002
Advantage Series: Microsoft® Word 2002
Sarah Hutchinson-Clifford
Glen Coulthard

Developing Applications In Word

Hands-On Exercises

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.

  1. Start a new blank document.
  2. Use the View menu to open all of the toolbars.
  3. CHOOSE: View, Toolbars, (name of toolbar)

    Continue until all of the toolbars are open. (The interface will be extremely cluttered.)

  4. 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.
  5.   Figure 11.1

    Record Macro dialog box

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072471026/26780/WCh11_acq_Image1.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (5.0K)</a>

  6. CLICK: Keyboard command button.
  7. Assign the macro to the Ctrl key+q keyboard combination.
  8. 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.
  9. Stop recording the macro.
  10. Open a few random toolbars and then use the Ctrl key+q keyboard combination to close them.
  11. To print the macro code:
  12. CHOOSE: Tools, Macro, Macros

    SELECT: FlightMemo in the list box

    CLICK: Edit command button

    CHOOSE: File, Print

    CLICK: OK command button

  13. 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.

  1. Open the "wd11xtra01.doc" Word file and save it to your personal storage location as "TempSol".
  2. 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.")
  3. CLICK: Keyboard command button
  4. Assign the macro to the Ctrl key+Alt key+q keyboard combination.
  5. 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
  6. Stop recording the macro.
  7. 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:
  8. CHOOSE: Tools, Macro, Macros

    SELECT: ReplaceName in the list of macros

    CLICK: Edit button

    The Visual Basic Editor will open.

  9. Select the section of code as shown in figure 11.2. Copy the text by choosing Edit, Copy.
  10.   Figure 11.2

    Visual Basic Editor

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072471026/26780/WCh11_acq_Image4.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (5.0K)</a>

  11. Insert a blank line above "End Sub" and paste the code in.
  12. In the pasted code, replace the text "Temporary Solutions" with "Temp Solutions".
  13. Close the Visual Basic Editor.
  14. In Word, run the macro and note that it made two additional replacements.
  15. 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.

  1. Open the "wd11xtra02.doc" Word file and enable macros if necessary.
  2. Save the document as "Jan’s Macros" to your personal storage location.
  3. Use the Tools, Customize command to open the customize dialog box.
  4. Using the Toolbars tab, create a new toolbar named "NewDocs" that will be stored in the current document.
  5. Add the following commands to the toolbar:
  6. =0 CELLPADDING=5 WIDTH=302>
    CommandCategory

    Project.NewMacros.NewFax

    Macro

    Project.NewMacros.NewMemo

    Macro

  7. Change the name of the Project.NewMacros.NewFax button to "Fax".
  8. Change the name of the Project.NewMacros.NewMemo button to "Memo".
  9. The toolbar should now appear similar to Figure 11.3.

      Figure 11.3

    NewDocs toolbar

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072471026/26780/WCh11_acq_Image5.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (1.0K)</a>

  10. 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.
  11.   Figure 11.4

    Docked toolbar

    <a onClick="window.open('/olcweb/cgi/pluginpop.cgi?it=gif:: ::/sites/dl/free/0072471026/26780/WCh11_acq_Image6.gif','popWin', 'width=NaN,height=NaN,resizable,scrollbars');" href="#"><img valign="absmiddle" height="16" width="16" border="0" src="/olcweb/styles/shared/linkicons/image.gif"> (14.0K)</a>

  12. Save and then close the revised "Jan’s Macros" document.




McGraw-Hill/Irwin