How to Record a Macro to Remove Extra Paragraph Marks

How to Record a Macro to Remove Extra Paragraph Marks
Purpose:
A macro is a mini-program within Word that you can use to automate processes. In this
exercise, we will record a macro that we can use to remove extra paragraph marks using
Find/Replace.
Once a macro is recorded, you can use it over and over again. You can assign the
macros to buttons on the Quick Access Toolbar. You can also assign them to buttons
and keyboard shortcuts.
Steps:
1. To start the recording, go to View > Macro > Record Macro.
2. You will be asked to provide a name for the macro. The name cannot have any spaces in it or
else you will get an error message.
Figure 1 Go to View > Macro > Record Macro
Figure 2 Make sure the name does not have spaces
Figure 3 If you have spaces in the name you will get this error
3. Your mouse pointer icon will turn into a Cassette Tape (looks like ). Word is now recording
your actions.
a. Note that during the recording, you have a very limited ability to actually edit text in the
document. Most of your changes will need to be done with keyboard shortcuts or by
clicking items in the ribbon.
How to Record a Macro to Remove Extra Paragraph Marks
4. The procedure we are recording will be to remove extra paragraph marks using the
Find/Replace feature. Paragraph marks can be represented in Find/Replace using ^p.
a. Bring up the Replace screen by using CTRL+H.
b. You are going to Find any instance where you have two consecutive paragraph marks
(i.e. ^p^p).
c. You are going to Replace any of these instances of two consecutive paragraph marks
with a single paragraph mark (i.e. ^p) – i.e. removing any extra ones.
Figure 4 The Replace operation to remove extra paragraph
marks
Figure 5 Message acknowledging that the operation
has been completed
d. Click Replace All. This will perform the replacement operation. You will receive a
message indicating how many replacements were done in the document.
i. Note that If you had only a portion of the document selected, it would also ask
you if you wanted to conduct the same operation in the rest of the document
outside of the area that you had selected. Click Yes or No depending on
whether or not you want to do this. During the macro recording, do NOT have
any text selected – do the Find/Replace on the entire document.
Figure 7 Word offer to search rest of document
Figure 6 Word offers to search the rest of the document
if you only had a portion of the text selected
How to Record a Macro to Remove Extra Paragraph Marks
5. Stop the recording.
a. If you check the Macro > View Macros list you should see your Macro listed.
6. Running the macro
a. You can now run the macro by going to Macro > View Macros and selecting your macro
from the list.
b. Alternatively, you could assign the macro to the Quick Access Toolbar (QAT). That way,
you can run the macro just by clicking a button on the QAT.