Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)

Slides:



Advertisements
Similar presentations
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Excel Project 4 Financial Functions, Data Tables, Amortization Schedules, and Hyperlinks.
Advertisements

Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Using Macros and Visual Basic for Applications (VBA) with Excel
Microsoft Office 2007 Excel Chapter 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Chapter 5 Multitable Forms
Office 2003 Advanced Concepts and Techniques M i c r o s o f t PowerPoint Project 4 Modifying Visual Elements and Presentation Formats.
Creating a Document with a Table, Chart, and Watermark
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 7 Creating an Online Form.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
Chapter 1 Creating a Flyer
Office 2003 Introductory Concepts and Techniques M i c r o s o f t PowerPoint Project 1 Using a Design Template and Text Slide Layout to Create a Presentation.
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Microsoft Office 2007 Access Chapter 4 Creating Reports and Forms.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t PowerPoint Project 1 Using a Design Template and Text Slide Layout to Create a Presentation.
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Excel Project 1 Creating a Worksheet and an Embedded Chart.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t PowerPoint Project 3 Using Visuals to Enhance a Slide Show.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Project 1 Creating and Editing a Word Document.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Creating, Formatting, and Editing a Word Document with a Picture
Chapter 5 Using Business Information Sets
Chapter 2 Enhancing a Presentation with Pictures, Shapes, and WordArt
Module 3 Productivity Programs Common Features and Commands Microsoft Office 2007.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Microsoft Office Word 2013 Core Microsoft Office Word 2013 Core Courseware # 3250 Lesson 8: Using Productivity Tools.
Access Tutorial 10 Automating Tasks with Macros
Chapter 10 Creating a Template for an Online Form
Microsoft Office 2007 Word Integration Feature Linking an Excel Worksheet and Chart to a Word Document.
Microsoft Office 2007 Microsoft Word Chapter 9 Enhancing an Online Form and Working with Macros, Document Security, and XML.
Microsoft Office 2007 Access 2007 Chapter 9 Administering a Database System.
Microsoft Word 2010 Chapter 1 Creating, Formatting, and Editing a Word Document with Pictures.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Exploring Microsoft Office Word 2007 Chapter 7 The Advanced User Robert Grauer, Keith Mulbery,
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
Chapter 2 Creating a Research Paper with References and Sources Microsoft Word 2013.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Introduction to MS WORD.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Switchboards, PivotTables, and PivotCharts.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Project 1 Creating and Editing a Word Document.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Microsoft Publisher 2010 Chapter 7 Advanced Formatting and Merging Publications with Data.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Chapter 4 Creating a Custom Publication from Scratch Microsoft Publisher 2013.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Microsoft Publisher 2010 Chapter 1 Creating a Flyer.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Access Project 1 Creating and Using a Database.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Lesson 10 Word Processing Unit 2—Using the Computer.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Chapter 7 Creating Templates, Importing Data, and Working with SmartArt, Images, and Screen Shots Microsoft Excel 2013.
Chapter 10 Creating a Template for an Online Form Microsoft Word 2013.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Excel Tutorial 8 Developing an Excel Application
Creating, Formatting, and Editing a Word Document with Pictures
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms
Chapter 7 Advanced Form Techniques
Shelly Cashman: Microsoft Word 2016
Microsoft Excel 2007 – Level 2
Presentation transcript:

Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 2 Objectives Unprotect a document Set a security level in Word Crop a graphic Create a new style that is associated with a shortcut key Modify a style

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 3 Objectives Modify a drawing object Record and execute a macro Customize toolbars and menus View and edit a macro’s VBA code Insert a VBA procedure

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 4 Objectives Run a macro when a user exits a form field Insert an ActiveX control, set its properties, and write its VBA procedure Work with the Protect Document task pane Attach a digital signature to a document

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 5 Unprotecting a Document Follow the instructions on pages WD 557 – WD 558 to open Word and save the document with a new file name Click Tools on the menu bar Click Unprotect Document on the Tools menu Click the Close button on the Protect Document task pane title bar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 6 Unprotecting a Document

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 7 Setting a Security Level in Word Click Tools on the menu bar and then point to Macro Click Security on the Macro submenu When Word displays the Security dialog box, if necessary, click the Security Level tab Click Medium Click the OK button

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 8 Setting a Security Level in Word

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 9 Cropping a Graphic Click the Crop button on the Picture toolbar Drag the right-middle cropping handle leftward to the location of the mouse pointer shown in figure 8-9 on page WD 565 Release the mouse button Click the Crop button on the Picture toolbar again

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 10 Cropping a Graphic

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 11 Creating a Style Associated with a Shortcut Key Click the Styles and Formatting button on the Formatting toolbar When Word displays the Styles and Formatting task pane, click the New Style button When Word displays the New Style dialog box, type DataEntryArea in the Name text box Click the Style type box arrow and then click Character In the Formatting area, click the Font box arrow and then click Century Gothic, click the Font Size box arrow and then click 11, click the Bold button (if necessary), and click the Font Color button arrow and then click Dark Red on the color palette

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 12 Creating a Style Associated with a Shortcut Key Click the Format button Click Shortcut key on the Format button menu When Word displays the Customize Keyboard dialog box, press ALT+D If necessary, click the Save changes in box arrow and then click A+ Dentist Locator Revised

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 13 Creating a Style Associated with a Shortcut Key Click the Assign button Click the Close button to close the Customize Keyboard dialog box Click the OK button in the New Style dialog box Click the Close button on the Styles and Formatting task pane title bar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 14 Creating a Style Associated with a Shortcut Key

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 15 Modifying a Style Click the Styles and Formatting button on the Formatting toolbar When Word displays the Styles and Formatting task pane, if necessary scroll through the list of styles until DataEntryArea appears in the list Right-click DataEntryArea in the list Click Modify in the list

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 16 Modifying a Style When Word displays the Modify Style dialog box, click the Font Color button arrow and then click Dark Blue on the color palette Click the OK button Click the Close button on the Styles and Formatting task pane title bar If necessary, scroll to display the entire form in the document window

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 17 Modifying a Style

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 18 Filling a Drawing Object with a Preset Color Scheme Fill Effect Select the rectangle by pointing to one of its edges and then clicking when the mouse pointer has a four-headed arrow attached to it If the Drawing toolbar is not displayed on your screen, click the Drawing button on the Standard toolbar Click the Fill Color button arrow on the Drawing toolbar and then click the Fill Effects button When Word displays the Fill Effects dialog box, if necessary, click the Gradient tab

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 19 Filling a Drawing Object with a Preset Color Scheme Fill Effect In the Colors area, click Preset Click the Preset colors box arrow, scroll to and then click Parchment Click the OK button

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 20 Filling a Drawing Object with a Preset Color Scheme Fill Effect

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 21 Recording a Macro and Assigning It a Shortcut Key Double-click the REC status indicator on the status bar When Word displays the Record Macro dialog box, type PrintFormData in the Macro name text box If necessary, click the Store macro in box arrow and then click Documents Based On A+ Dentist Locator Revised Select the text in the Description text box and then type Prints only the data on a form Click the Keyboard button

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 22 Recording a Macro and Assigning It a Shortcut Key When Word displays the Customize Keyboard dialog box, press ALT+P Click the Assign button Click the Close button in the Customize Keyboard dialog box Click File on the menu bar Click Print on the File menu

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 23 Recording a Macro and Assigning It a Shortcut Key When Word displays the Print dialog box, click the Options button When Word displays the second Print dialog box, place a check mark in the Print data only for forms check box Click the OK button in each dialog box Click the Stop Recording button on the Stop Recording toolbar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 24 Recording a Macro and Assigning It a Shortcut Key

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 25 Running a Macro Press ALT+P

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 26 Adding a Button to a Toolbar Click Tools on the menu bar Click Customize on the Tools menu When Word displays the Customize dialog box, if necessary, click the Commands tab Scroll to and then click Macros in the Categories list

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 27 Adding a Button to a Toolbar Click TemplateProject.NewMacros.PrintFormData in the Commands list Drag the selected command in the Commands list to the Standard toolbar between the Print and Print Preview buttons Right-click the button just added to the Standard toolbar and then point to Change Button Image on the shortcut menu

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 28 Adding a Button to a Toolbar In the palette of button images, click the button with the image of the text on pages Right-click the button just added to the Standard toolbar Click Text Only (in Menus) Click the Close button in the Customize dialog box

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 29 Adding a Button to a Toolbar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 30 Deleting a Button from a Toolbar Click Tools on the menu bar and then click Customize Right-click the button to be deleted, in this case, the Print Form Data button Click Delete on the shortcut menu Click the Close button in the Customize dialog box

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 31 Deleting a Button from a Toolbar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 32 Viewing a Macro’s VBA Code Click Tools on the menu bar and then point to Macro Click Macros on the Macro submenu When Word displays the Macros dialog box, if necessary, click the Macros in box arrow and then click A+ Dentist Locator Revised (template) If necessary, click AutoNew in the Macro name list Click the Edit button

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 33 Viewing a Macro’s VBA Code If the Code window is not displayed in the Visual Basic Editor, click View on the menu bar and then click Code If the Project Explorer window is displayed, click its Close button If the Properties window is displayed, click its Close button If the Code window is not maximized, double-click its title bar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 34 Viewing a Macro’s VBA Code

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 35 Modifying Existing Code Double-click the 6 at the end of the executable code statement above the End Sub statement Type 7 as the new number of lines to scroll

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 36 Inserting a Visual Basic Procedure Press ALT+F11 to open the Visual Basic Editor in a new window If the Project Explorer is displayed, click its Close button If the Properties window is displayed, click its Close button If the Code window is not displayed, click View on the menu bar and then click Code

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 37 Inserting a Visual Basic Procedure If necessary, double-click the title bar of the Code window to maximize it Click the Insert UserForm button arrow on the Standard toolbar Click Procedure in the list When Visual Basic displays the Add Procedure dialog box, type RatingScaleValidation in the Name text box Click the OK button

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 38 Inserting a Visual Basic Procedure

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 39 Running a Macro when a User Exits a Form Field Double-click the text form field for the rating scale When Word displays the Text Form Field Options dialog box, click the Exit box arrow and then click RatingScaleValidation Click the OK button

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 40 Running a Macro when a User Exits a Form Field

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 41 Inserting an ActiveX Control If the Control Toolbox toolbar is not displayed on the screen already, click View on the menu bar, point to Toolbars, and then click Control Toolbox If formatting marks are not displayed on the screen already, click the Show/Hide ¶ button on the Standard toolbar Click the paragraph mark at the end of the form and then press the ENTER key Click the Center button on the Formatting toolbar Click the Command Button button on the Control Toolbox toolbar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 42 Inserting an ActiveX Control

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 43 Setting Properties of an ActiveX Control With the command button selected and Word in design mode, click the Properties button on the Control Toolbox toolbar When the Properties window opens, if necessary, click the Properties box arrow and then click CommandButton1 in the list If necessary, click the Alphabetic tab If necessary, drag the right edge of the Properties window to make it wider

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 44 Setting Properties of an ActiveX Control In the list, click Caption in the left column and then drag through the value, CommandButton1, to its right Type Click Here When Finished as the new caption Click the AutoSize property Click the AutoSize button arrow and then click True

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 45 Setting Properties of an ActiveX Control Click the BackColor property, click the BackColor button arrow, click the Palette tab, and then click Dark Red on the color palette Click the ForeColor property, click the ForeColor button arrow, click the Palette tab, and then click Tan on the color palette Click the Font property Click the button at the right of the Font value box

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 46 Setting Properties of an ActiveX Control When Word displays the Font dialog box, scroll through the Font list and click Rockwell; if necessary, click Bold in the Font style list; and then click 12 in the Size list Click the OK button If necessary, click the A+ Dentist Locator Revised – Microsoft Word program button on the taskbar to redisplay the form on the screen Click the Close button on the Properties window title bar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 47 Setting Properties of an ActiveX Control

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 48 Entering the Click Here When Finished Button Procedure With Word in design mode, click the Click Here When Finished button and then point to the View Code button on the Control Toolbox toolbar Click the View Code button If the Project Explorer window opens, click its Close button If necessary, double-click the Code window title bar to maximize the window With the insertion point on the blank line between the Sub and End Sub statements in the Code window, type the code statements shown in lines 2 through 15 in Table 8-8 on page WD 611. Make sure you type an apostrophe at the beginning of each comment line. For clarity, indent the code statements as shown in Table 8-8

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 49 Entering the Click Here When Finished Button Procedure Verify your code statements by comparing them to Figure 8-68 on page WD 613 Click the Close button on the right edge of the Microsoft Visual Basic title bar to return to the online form Click the Exit Design Mode button on the Control Toolbox toolbar Click the Close button on the Control Toolbox toolbar title bar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 50 Entering the Click Here When Finished Button Procedure

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 51 Protecting the Form Using the Protect Document Task Pane Click Tools on the menu bar and then click Protect Document When Word displays the Protect Document task pane, click the Editing restrictions check box, click the Editing restrictions box arrow, and then click Filling in forms Click the Yes, Start Enforcing Protection button and then click the OK button Click the Close button on the Protect Document task pane title bar If necessary, scroll to display the entire form in the document window

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 52 Protecting the Form Using the Protect Document Task Pane

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 53 Digitally Signing a File Click Tools on the menu bar and then click Options When Word displays the Options dialog box, if necessary, click the Security tab Click the Digital Signatures button Click the Add button

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 54 Digitally Signing a File If Word displays a dialog box, warning you about fonts, text, or pictures, click the Yes button When Word displays the Select Certificate dialog box, click the certificate you wish to add. If your computer does not display any certificates, click the Cancel button in each dialog box and skip the next step Click the OK button in each dialog box Click the Save button on the Standard toolbar

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 55 Digitally Signing a File

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 56 Summary Unprotect a document Set a security level in Word Crop a graphic Create a new style that is associated with a shortcut key Modify a style

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 57 Summary Modify a drawing object Record and execute a macro Customize toolbars and menus View and edit a macro’s VBA code Insert a VBA procedure

Word Project 8: Working with Macros and Visual Basic for Applications (VBA) 58 Summary Run a macro when a user exits a form field Insert an ActiveX control, set its properties, and write its VBA procedure Work with the Protect Document task pane Attach a digital signature to a document

Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Complete