次の方法で共有


Novice Challenge 2: What Did I See?

Office Programs Required

Microsoft Word 2007

Goldfish Awarded

5

Deadline for Submission

Wednesday, April 22, 2009 (8:00 AM Pacific Daylight Time)

Files Required

NoviceChallenge02.docm in the OfficePalooza Challenge Pack.

In this challenge we’re going to use Microsoft Office Word to tell a story. The story is mostly written, with one exception: there’s no subject. Instead, the string <subject> is interspersed throughout the story. To successfully complete this challenge, you’ll need to write code that prompts the user for a subject, then replaces the <subject> string with a new subject.

The prompt displayed to the user must be in the form of an input box. When the code is run, an input box like the following should be displayed:

Novice Challenge 2 

If the user cancels the input box, nothing should happen. However, if the user enters text into the input box and clicks OK, the string that was input should replace every occurrence of <subject> in the story.

When you open the Visual Basic editor (which you can do by pressing Alt+F11), there should already be a window open with the subroutine ChangeSubject showing. Insert your code into this subroutine. (If you don’t see this subroutine, double-click on ThisDocument in the Project pane on the left under VBAProject (NoviceChallenge02).) Do not create any other subroutines – all your code should go in here.

Important: Do not add code to save the document.

Submitting Your Entry

The OfficePalooza sweepstakes is over, but you’re welcome to try the challenges and learn on your own. Good luck!