Join Gini von Courter for an in-depth discussion in this video View a macro in the Visual Basic Editor, part of Word: Automating Your Work with Macros.
- [Instructor] What the macro recorder does…is it takes our keystrokes,…and from those keystrokes…and choices that we make on the ribbon,…it generates code in Visual Basic,…specifically in VBA or Visual Basic for Applications.…And we can view that Visual Basic,…so that we can look at how our macro's going to work.…Also, we could edit our macro if we wish.…To jump into the macro editor click on Macros…and then choose the macro that you want to see…and click Edit.…
Now we're going to see both of these macros,…because both of them are stored in the same location.…But I'm going to click Edit,…and at the top here's our macro.…It says Sub,…because this is technically called a subroutine,…FormatReport, here's the name of the macro.…The items that are in green…with an apostrophe in front of them are comments,…they're not part of the code,…they're simply information about the code.…And notice then what we're doing…as we work through the macro.…
The first line says Selection WholeStory…and that would be ctrl + a, select the whole document.…
- List the steps required to run the macros on a document you created when you open the document and see a SECURITY WARNING banner message.
- Explain how to run a macro.
- Identify where to save a building block if there is no logical gallery for it.
- Recall the best way to create an auto macro.
- Recognize why you would create a macro in the Visual Basic Editor rather than using the Macro Recorder.
- Identify what you can add any existing macro to.