1 / 28

Word Lesson 16 Working with Macros

Word Lesson 16 Working with Macros. Microsoft Office 2010 Advanced. Cable / Morrison. Objectives. Create a macro-enabled document. Name, store, record, and run a macro. Choose a macro security setting. Create a document template to store macros. 2. 2. Objectives (continued).

ciqala
Télécharger la présentation

Word Lesson 16 Working with Macros

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Word Lesson 16Working with Macros Microsoft Office 2010 Advanced Cable / Morrison

  2. Objectives • Create a macro-enabled document. • Name, store, record, and run a macro. • Choose a macro security setting. • Create a document template to store macros. 2 2

  3. Objectives (continued) • Create shortcuts to run macros. • Edit macros. • Copy, delete, and rename macro projects. • Add a digital signature to a macro project.

  4. Vocabulary • code • macro • macro project • VBA (Visual Basic for Applications) • virus 4 4

  5. Understanding Macros • A macro is a group of sequential commands and actions combined as a single command to automatically complete a task. • Word provides numerous ready to use macros. • Creating your own macros enables you to automate repetitive tasks.

  6. Understanding Macros (continued) • Code is a set of instructions and data for a computer program. • Code that Word creates is for VBA (Visual Basic for Applications). • VBA (Visual Basic for Applications) is a computer programming language and environment designed for use within Office and other Microsoft applications.

  7. Creating and Storing Macros in a Document • You can store macros in a document or in a template. • When stored in a document, macros are only available for that document.

  8. Creating and Storing Macros in a Document (continued) • Creating a Macro-Enabled Document • When you store a macro in a document, the document must be saved in macro-enabled document format. • Default format for a Word document has the file extension .docx. • Format for a macro-enabled document has the file extension .docm.

  9. Creating and Storing Macros in a Document (continued) • Naming and Storing a Macro • Before recording a macro, you must name the macro and assign a location to store it. • Macro name must begin with a letter and can contain up to 80 letters and numbers. • Unless you specify a different location, Word saves macros in the Normal (*.dotm) template. • You can save the macro to the normal template, the current document, or a document template.

  10. Creating and Storing Macros in a Document (continued) • Recording the Macro Actions • Plan the actions required to perform the task before you begin recording a macro. • Any mistakes and corrections you make as you record will be saved in the macro. • Make every effort to avoid prompts Word might display that require a response from you.

  11. Creating and Storing Macros in a Document (continued) • Recording the Macro Actions (continued) Record Macro dialog box

  12. Running Macros • A virus is a computer program designed to replicate itself; often causes damage to computer data. • Sometimes viruses are stored in macros. • To counter potential corruption due to a virus, Word offers several security levels for running macros.

  13. Running Macros (continued) • Choosing a Macro Security Setting Macro security settings

  14. Running Macros (continued) • Running a Macro • You can run your macro by opening the Macros dialog box. • Before applying the macro, be sure to select the appropriate text or reposition the insertion point.

  15. Creating a Document Template to Store Macros • When stored in Normal.dotm template, macros are available to all users of the computer for all documents and at any time. • When macros are stored in a document template, they are available only when the document template is global or is attached to a document.

  16. Creating and Deleting Macro Shortcuts • You have the option to assign a keyboard shortcut or a button to a macro. • You cannot assign a shortcut key combination and a button at the same time. • If you no longer use a macro, you can delete the shortcut.

  17. Creating and Deleting Macro Shortcuts (continued) • Creating a Macro with a Keyboard Shortcut • You must choose a key combination that is not already assigned to other commands or functions. Customize Keyboard dialog box

  18. Creating and Deleting Macro Shortcuts (continued) • Creating a Macro with a Button Shortcut • When you create a button shortcut for a macro, it is added to the Quick Access Toolbar. • When recording a macro: • You can use the mouse to choose commands and click buttons. • You cannot record mouse movements within the document window; you must use keystrokes.

  19. Creating and Deleting Macro Shortcuts (continued) • Creating and Deleting Shortcuts for Existing Macros • You can easily create shortcuts for existing macros, and customize button icons. Customize Keyboard dialog box showing available macros and assigned keys

  20. Editing Macros • Generally the easiest way to change a macro is to record it again. • If the macro is complex and the changes you want to make are minor, consider editing the macro code. • You can edit the code in the Visual Basic Editor (VBE) window.

  21. Copying, Deleting, and Renaming Macro Projects • When macros are stored in a document or in a template, they are stored as a collection in a macro project. • Options in the Organizer dialog box enable you to copy, delete, and rename macro projects.

  22. Signing a Macro Project • Signing the macro project by adding a digital signature will enable users who run the macro to identify its creator and be assured that the macro has not been altered.

  23. Restoring Settings • It’s good practice to review the settings you have customized before ending a Word session. • For example, if you don’t want the changes to affect future documents, it is easier to restore original settings before exiting Word.

  24. Summary In this lesson you learned: • You can store a macro in a document or in a template. When stored in a document, macros are only available for that document. • When you create a macro, you record the sequence of actions necessary to perform a task.

  25. Summary (continued) • Word enforces a security level for running macros. Depending on the security level, you may need to enable macros when you open a document. • To make macros available for other documents, you can store them in the normal template or in a document template.

  26. Summary (continued) • To create shortcuts to run a macro, you can assign a shortcut key combination or you can add a new button to the Quick Access Toolbar. • To run a macro, you can use the Macros dialog box or a keyboard or button shortcut.

  27. Summary (continued) • When you want to change a macro, you can re-record it or you can edit it in the Microsoft Visual Basic Editor. • You can copy macro projects to make them available to other documents and users. When you no longer need a macro, you can delete it from the macro project.

  28. Summary (continued) • You can rename macro project groups to help organize your macros. • When sharing macros with others, you should sign the macro project by adding a digital signature.

More Related