Macro of the Month – September 2021 – PasteUnformatted
Pastes text and applies the formatting of the surrounding text
Welcome. This month’s macro makes pasting text in Word more efficient. We’ll also wrap up the brief series about common errors when installing and using macros and how you can avoid them. (You can read the previous two installments here and here.) And for those new to macros, there is a free training for Mac users, with a PC date to be determined.
PasteUnformatted
When we paste text into a Word document, by default the original formatting comes with it. Word provides alternative ways to paste text, such as changing the formatting to match the surrounding text. Those require extra clicks. PasteUnformatted eliminates these clicks.
Once you’ve copied text to the clipboard, simply use your keyboard shortcut for PasteUnformatted and the text neatly adopts the surrounding formatting.
Warning: I almost always want to paste text to match the destination formatting. Therefore, on my Mac I “cleverly” assigned Cmd+V to this macro. Cmd+V is already assigned to Word’s paste function. I discovered, however, that when I wanted to paste a word in the find/replace window, nothing happened. I now use Cmd+Opt+V for PasteUnformatted.
Common Error #3: All your macros have disappeared
When Word crashes or updates, it can cause your Normal template to reset. Your Normal template is where your macros are stored. When the file resets, your macros will be deleted.
You could easily reinstall your macros one by one if that happens to you. However, having to track down the macro code and reinstall each macro separately is tedious, not to mention frustrating, especially if you use a lot of macros.
Get in the habit of backing up your macros so that you can easily reinstate them.
Follow these steps to back up your macros:
Open Visual Basic (Alt+F11 on a PC; Opt+F11 on a Mac).
Copy all the text.
Select all the text at once by selecting Ctrl+A/Cmd+A.
Copy the select text by selecting Ctrl+C/Cmd+C.
Open a new Word document.
Paste the text into a Word document by selecting Ctrl+VCmd+V.
Save the document in an easy-to-find location. Tip: Add the date to the file name so you know which is the most recent backup.
Note: This method does not back up your keyboard shortcuts.
Follow these steps to reinstall your macros if you lose them:
Open the backup document.
Copy all the text.
Select all the text at once by selecting Ctrl+A/Cmd+A.
Copy the select text by selecting Ctrl+C/Cmd+C.
Follow your regular steps for installing macros, this time installing all of them at once.
Warning: Do this only if all your macros have disappeared. If you install a macro that is already installed, you will now have two copies of the macro in Visual Basic and you will get an error when you try to run the macro.
Upcoming Training
Are you a Mac user and nervous about getting started with macros? Paul Beverley will be guiding a fellow nervous editor through his Macros by the Tourist Route on a Mac, a beginner method for installing and using macros. You’re invited to join in and ask questions.
This free session will be held on Zoom on Thursday September 30 at 4pm UK time/11am ET. Email Paul for access details.
If you would like to join a session for PCs, email Paul and let him know you’re interested.
What macro do you find yourself using most these days? Do you have a question about macros you’d love the answer for? Email me.
Be safe and well,
Jennifer