macro

advertisement
Microsoft
Word 2013
Chapter 11
Enhancing an Online Form
and Using Macros
Objectives
•
•
•
•
•
•
•
Unprotect a document
Specify macro settings
Convert a table to text
Insert and edit a field
Create a character style
Apply and modify fill effects
Change a shape
Enhancing an Online Form and Using Macros
2
Objectives
•
•
•
•
•
•
•
Remove a background from a graphic
Apply an artistic effect to a graphic
Insert and format a text box
Group objects
Record and execute a macro
Customize the Quick Access Toolbar
Edit a macro’s VBA code
Enhancing an Online Form and Using Macros
3
Project – Online Form Revised
Enhancing an Online Form and Using Macros
4
Using Macros
• A macro is a set of commands and instructions
grouped together to allow a user to accomplish a
task automatically
• This single command is a convenient way to
automate a difficult or lengthy task
• Macros often are used to simplify formatting or
editing activities, to combine multiple commands
into a single command, or to select an option in a
dialog box using a shortcut key
Enhancing an Online Form and Using Macros
5
Recording a Macro
• The macro recorder creates a macro based on a
series of actions you perform while the macro
recorder is recording
• The macro recorder is similar to a video camera:
after you start the macro recorder, it records all
actions you perform while in a document and stops
recording when you stop the macro recorder
• After you record a macro, you can execute the macro,
or play it, any time you want to perform the same set
of actions
Enhancing an Online Form and Using Macros
6
Recording a Macro
and Assigning It a Shortcut Key
Enhancing an Online Form and Using Macros
7
Saving a Macro-Enabled Template
• To provide added security to templates, a basic
Word template cannot store macros
• You must save your document as a macro-enabled
document/template instead
• In order for macros to play, you must enable the
macros
• If you make a mistake while recording the macro,
delete it and record it again
Enhancing an Online Form and Using Macros
8
Saving a Macro-Enabled Template
Enhancing an Online Form and Using Macros
9
Specifying Macro Settings in Word
Enhancing an Online Form and Using Macros
10
Using a Macro to Automate a Task
• A macro consists of VBA (Visual Basic for
Applications) instructions
• To edit a recorded macro you use the Visual Basic
Editor
• With the macro recorder, Word generates the
VBA instructions associated with the macro
automatically as you perform actions in Word
Enhancing an Online Form and Using Macros
11
Editing a Macro’s VBA Code
• When writing a VBA procedure, comments are
often added to help you remember the purpose
of the macro and its code statements at a later
date
• Comments begin with an apostrophe and appear
in green in the Code window
• Comments have no effect on the execution of a
procedure; they simply provide information about
the procedure, such as its name and description,
to the developer of the macro
Enhancing an Online Form and Using Macros
12
Editing a Macro’s VBA Code
Enhancing an Online Form and Using Macros
13
Inserting a Date Field
• The current date and time field in a form automatically
displays the current date and time
Enhancing an Online Form and Using Macros
14
Applying an Artistic Effect
• Word provides several different artistic effects,
such as blur, line drawing and paint brush, that
alter the appearance of a picture
Enhancing an Online Form and Using Macros
15
Applying an Artistic Effect
Enhancing an Online Form and Using Macros
16
Grouping Objects
• When you have multiple graphics, such as
pictures, clip art, shapes, and text boxes,
positioned on a page, you can group them so that
they are a single graphic instead of separate
graphics
Enhancing an Online Form and Using Macros
17
Grouping Objects
Enhancing an Online Form and Using Macros
18
Setting Exceptions to Editing
Restrictions
• You can use the Restrict Editing task pane to allow editing
in just certain areas of the document, a procedure called
adding users excepted from restrictions
• To do this, place a check mark in the ‘Allow only this type of
editing in the document’ check box and then change the
associated text box to ‘No changes (Read only)’, which
instructs Word to prevent any editing to the document
• Next, select the placeholder text for which you want to
except users from restrictions and place a check mark in the
Everyone check box in the Exceptions (optional) area to
instruct Word that the selected item can be edited—the
rest of the form will be read only
Enhancing an Online Form and Using Macros
19
Adding a Digital Signature to a
Document
• Some users attach a digital signature to a
document to verify its authenticity
• A digital signature is an electronic, encrypted, and
secure stamp of authentication on a document
• This signature confirms that the file originated
from the signer (file creator) and that it has not
been altered
Enhancing an Online Form and Using Macros
20
Adding a Digital Signature to a
Document
• A digital signature references a digital certificate
• A digital certificate is an attachment to a file,
macro project, email message, or other digital
content that vouches for its authenticity, provides
secure encryption, or supplies a verifiable
signature
• Many users who receive online forms enable the
macros based on whether they are digitally signed
by a developer on the user’s list of trusted sources
Enhancing an Online Form and Using Macros
21
Adding a Signature Line to a Document
• A digital signature line, which resembles a printed
signature placeholder, allows a recipient of the
electronic file to type a signature, include an
image of his or her signature, or write a signature
using the ink feature on a Tablet PC
• Digital signature lines enable organizations to use
paperless methods of obtaining signatures on
official documents such as contracts
Enhancing an Online Form and Using Macros
22
Download