Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Word > Macro to Delete Stuff < Remove Line Breaks | Default Template >
Macro to Delete Stuff
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   2 years ago

Record a Macro to Delete Stuff in Word Documents


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

In this Microsoft Access tutorial, I will show you how to record a macro to delete stuff (pictures, characters, line breaks, etc.) in Microsoft Word documents. We'll learn how to turn on the Developer tab of the Ribbon, see how to use the Macro Recorder, edit a macro in the VBA editor, and more!

Learn More

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Diamond Sponsors - Information on our Sponsors
Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted
Merch Store - Get your swag here!

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

Keywords

#msword, #microsoftword, #help, #howto, #tutorial, #learn, #lesson, #training, #fasttips, TechHelp Access 2016, Access 2019, Access 2021, Access 365, Microsoft Access, MS Access, MS Access Tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, macro recording Word, delete duplicates, keystroke deletion, record macro button, assign keyboard shortcut, VBA editor, automate tasks Word, VBA programming Word, quick macro guide, insert signature macro, streamline editing Word, Word macro tutorial

 

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Macro to Delete Stuff
Get notifications when this page is updated
 
Intro In this video, I will show you how to create a simple macro in Microsoft Word to quickly delete extra content, such as unwanted screenshots, by assigning a keyboard shortcut using the macro recorder. You will learn how to enable the Developer tab, record a macro, assign it to a keyboard shortcut, and make minor edits in the VBA editor to fine-tune your macro's behavior. I will also talk about how you can use the same process to automate tasks like inserting frequently used text.
Transcript In today's video, I'm going to show you how to make a quick macro to delete stuff in your Microsoft Word documents. Okay, this video is going out to one of my new handbook editors, Sandra.

What I've been doing lately is using AI and a program that I wrote to generate most of the handbooks for my courses automatically. And it does a pretty good job. It cleans up the grammar and all that, basically takes the text out of the video, and it inserts screenshots wherever it thinks there's key changes or where there's stuff that should be displayed in the handbook. But the problem is that I've got it programmed to include more screenshots than necessary. So you have to go through and like here, for example, you got two screenshots that are nearly identical. You have to go through and you have to select them and delete that, and that can take a few minutes. Okay.

So what I want to show Sandra is how to put together a real quick macro where you can just click in front of the picture and then either hit a button or hit a keystroke. I like keystrokes myself. And then it will just delete the picture without having to do a click and then drag and select and all that stuff. Just nice and fast. You click right in front of the picture, hit a keystroke, boom.

Now fortunately for me, since this is AI-generated, it's the exact number of spaces from the spot where the cursor is right in front of the picture. It's 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 characters that you can delete with your macro. Okay, now we can use the macro recorder in Word to set this up. Word's got a macro recorder, Excel's got a macro recorder. The only thing it doesn't have a macro recorder is Access because, of course, Access is the red-headed stepchild of Microsoft Office, but I'll save that for another video.

So I'm just going to show you in this video how to do a real quick macro just to delete some stuff. And I plan on having much more in-depth, comprehensive videos on macro recording in Word because I'm going to be redoing my entire Microsoft Word series very soon here. But the first thing you have to do in Word is turn on the developer tab on your ribbon. Now, you may not have it because it's not on by default. So, you're going to right-click, go to customize the ribbon. That'll bring up this guy, the options. Go to customize ribbon. And over here, you'll see the developer tab. Normally that's not checked. So all you have to do is check that box, hit OK, boom, there you go.

Okay, now we've got the developer tab available. And right here, all you're going to work with is record macro, and that's pretty much it. You're going to turn the recording on, you're going to do some stuff, and then you're going to stop recording. Again, I'm just going to show you the basics. What we're going to do is we're going to click right in front of that picture. Don't click on the picture. I like to click in front of it. You can do a macro if you want it with it on, but I like to click over here in the front. Once you've clicked there, you're going to click on record macro.

Now keep in mind that the macro recorder only records keystrokes. It's not going to record your mouse clicks. Most of the time there are some mouse clicks that you can record. But generally, it's just your keyboard keystrokes.

Now, first thing, give the macro a name. Let's call this delete picture. No spaces. Delete picture. You can either assign it to a button or a keyboard. I personally prefer a keyboard shortcut, so I'm going to click on keyboard right here, press new shortcut key. I like to keep all my macros as ctrl-shift-something because your chances are you're not going to run into conflicts with other stuff, so let's go ctrl-shift-D. Alright, now normally that's double underline, I never use double underline, so that's good, let's hit assign, you'll see it's now assigned to that keystroke, we'll hit close, and now we're recording. Okay, see right here, it says pause recording. That means we're good, we're going.

Okay, so now, notice your mouse pointer's changed. Now you're going to do everything with the keyboard that you want to do when this macro runs. I'm going to hit delete 11 times. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, maybe one more, let's see, one more. Okay, it might be 12. That might be too much, but we can edit it, don't worry. Now that we're done, let's hit stop recording. Okay, that macro is done.

Now where'd that macro go? You can click on this macros right here to see a list of all your macros. There's delete picture. You can run it right from here if you want to. Okay, or if you know VBA, if you've used, you know, Access or Excel or whatever, you can click on edit and it will actually launch the VBA editor and there it is. It's real simple. Selection.Delete, Unit=wdCharacter, Count=1. All right, what do we got? One, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve. You can just do this. Watch. Count equals twelve and then get rid of all those. That's something that you can do like that. So if you know VBA, you can come in here and make changes. The VBA language for Word is a whole lot different than from Access and Excel. So it's, I pretty much, I stick to using the Macro Recorder myself, and then I just come in here and tweak it.

Alright, let's save that. Let's close the VBA window, and now let's try running it again. Let's try getting rid of this guy. I'm going to zoom out just a little bit. Alright, let's try getting rid of this guy. Ready? Ctrl-Shift-D. Boom! Okay, it looks like I got rid of a little bit too much. Let's undo that. Ctrl-Z. Control Z, yeah, we went one character too many. All right, let's back that up to 11 characters, which is what I thought it was going to be, but I wanted to do with this so I can show you how to come in here and edit it too. Delete picture, hit edit. Let's change this to Count=11. Save it, Ctrl-S, we're going to close this. Let's come back out here now. If we run this correctly, this picture should still be there, the 6:10 picture. All right, so we're going to click in front of this one, Ctrl-Shift-D. Boom. Perfect. There we go. We got the 6:10 picture.

So now I can go looking down my document. See, it puts a lot of screenshots in sometimes where it doesn't need them and puts some doubles in. Let me see if I can find another one. So, like right here. This one's pretty much the same thing as that one. So now all I have to do is click in front of that one, right click in front of it, Ctrl-Shift-D. Boom, it gets rid of it. Yeah, let's get rid of this one, Ctrl-Shift-D, boom, gone. And you can use this technique for doing all kinds of stuff.

I just made a quick video for her to show you how to delete stuff, but you can make a macro to add stuff too. Let's say, let's go to a new document real quick. Alright, let's say you're writing a letter to your mom. You know, hi, and you want to have a closing you put on the end that's always the same thing. Drop it in a macro, right? Developer, record macro, insert signature. I'm taking signature, I can't type today, signature. Alright, keyboard, let's go Ctrl-Shift-S. Alright, that's normally style, now, that's fine, assign it, hit close, and now, whatever you type is going to be your signature so, Richard Rost. Let's back that up, shift-enter, my email address, shift-enter, and then uh, phone number. Okay, now, if you're just going to use the keyboard, you can still come up here, up, up, shift, and bold that, right? You can do all kinds of stuff as long as you can get away with the keyboard. Alright, like that, and then we're done.

Okay, now every keystroke you just did got recorded, so the next time you write a letter, all you do is Ctrl-Shift-S, boom, there it is. See, and if you look at your macros, insert signature, edit, there it is. Right, see? All type in that text, paragraph, backspace. See, here's the paragraph and then the backspace. Here I got, it's Ctrl-11 is actually that shift-enter for the line break instead of a whole paragraph. There's all kinds of stuff you can do. You can come in here and edit this. You can re-record it. You can have fun.

Again, I'll cover this stuff in a lot more detail in my full Word course and in more TechHelp videos coming out with my word course. So stay tuned.

So there you go. There is your TechHelp video for today. I hope you learned something. Live long and prosper, my friends. I'll see you next time.
Quiz Q1. What is usually the main cause of the unrecognized database format or inconsistent state error in Access?
A. The users have improper permissions
B. A network outage or improper shutdown causes corruption
C. The database has been intentionally tampered with
D. The database file is too large for Access to handle

Q2. What is the recommended first step to fix a corrupted Access database according to the video?
A. Reinstall MS Access
B. Run a daily backup
C. Perform a compact and repair on the database
D. Upgrade to SQL Server

Q3. Where should you perform the compact and repair operation on a corrupted Access database file?
A. Over the network
B. On a wireless connection
C. On your local workstation
D. On a shared network drive without copying it locally

Q4. In case you can't open the Access database to perform compact and repair within Access itself, what can be done to repair it?
A. Delete the file and restore from a backup
B. Use the built-in Windows disk error checker
C. Perform a compact and repair from a command prompt
D. Move the database to a different server

Q5. What should you delete if it's still present in your back-end folder after a fix attempt and everyone is out of the database?
A. The .ACCDB file
B. The .LACCDB file
C. The temp files
D. The log files

Q6. Why is it recommended to ensure all users are running the same version of Access?
A. Differing versions do not affect the database
B. Access cannot run on different operating systems simultaneously
C. Different versions can lead to compatibility issues and contribute to corruption
D. Access files are different sizes on different versions

Q7. Moving the back-end database file to a different folder can sometimes inexplicably fix issues. What is this technique compared to in the video?
A. Changing the database format
B. Upgrading Access to the latest version
C. Like going to the doctor and getting advice to change behavior to avoid pain
D. Similar to adjusting network settings

Q8. What should the back-end file name format be to possibly avoid issues, as suggested in the video?
A. Complicated with special characters for security
B. Long with descriptions
C. Short with no spaces
D. Including version numbers

Q9. Which of the following is NOT one of the recommendations mentioned in the video for preventing or fixing a corrupted Access database?
A. Keeping the server's disk drive error-free and uncompressed
B. Running the Access database over a wireless network
C. Checking for network errors with tools like Fing Network Monitor
D. Making sure there's ample free disk space relative to the database file size

Q10. What is the maximum theoretical number of users that can be connected to an Access backend simultaneously?
A. 50 users
B. 100 users
C. 255 users
D. Unlimited as long as the network supports it

Q11. When might it be time to consider upgrading from an Access database to SQL Server?
A. When frequent network errors occur
B. If there are more than 15 to 20 simultaneous users
C. When the database grows beyond 100 tables
D. If the Access database file reaches 500MB in size

Answers: 1-B; 2-C; 3-C; 4-C; 5-B; 6-C; 7-C; 8-C; 9-B; 10-C; 11-B;

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary Today's video from the Microsoft Word Learning Zone is focused on how to create a simple macro to help you quickly delete items in your Word documents. I put this together primarily for one of my new handbook editors, Sandra, who has been helping me polish the handbooks for my courses.

Let me give you a little background on the problem we're solving. Recently, I have been using AI and some custom programs I wrote to automatically generate the handbooks for my courses. Usually, this process does a pretty good job. It improves the grammar, extracts text from my videos, and inserts screenshots at points where important changes happen or new material should be highlighted. However, the system often adds more screenshots than necessary. You end up with several that are almost identical. To clean this up, you need to go through the document, find the duplicates, select them, and delete them. Doing this manually can be tedious and time-consuming.

To make Sandra's job easier, I want to demonstrate how to build a quick macro. With this, you can click directly in front of an unwanted picture and use a keyboard shortcut to delete it. This avoids the hassle of dragging your mouse or meticulously selecting the item. It streamlines the process to just a click of the mouse followed by a keystroke.

Because these handbooks are generated by AI, there is a consistent pattern to the number of characters between the spot where your cursor is positioned before the picture and the picture itself. In this case, you have to delete 11 characters to remove an image. That makes this task ideal for automating with a macro.

Word has a built-in macro recorder that can help you with this. (Interestingly, Access is the only major Office program that does not have a macro recorder – but I will discuss that another time.) For now, we will stick with Word.

If you want to use macros in Word, the first step is to enable the Developer tab on your ribbon, since it is not there by default. To do this, right-click anywhere on the ribbon and choose to customize it. From the Word options window, find and check the box for the Developer tab. Click OK, and now you will see the Developer tab in your ribbon.

Most of what we need is under the Developer tab. The critical buttons are for starting and stopping macro recording. For this basic example, place your cursor in front of the picture you want to delete. Make sure you're at the right spot; I prefer this over clicking directly on the image.

Start recording your macro. Remember, the recorder tracks keys you press but generally ignores mouse movements unless they're command-related. Give your macro a clear name, like "deletepicture" (no spaces), and assign it to a keyboard shortcut for efficiency. I recommend using Ctrl-Shift plus another letter that's unlikely to conflict with built-in shortcuts. I chose Ctrl-Shift-D for this demonstration.

After assigning your shortcut, the macro recorder is running. At this point, perform the actions you want your macro to automate. In our situation, I hit the delete key 12 times. This turned out to be one too many, but don't worry – you can always tweak your macro later.

Once you've performed your steps, stop the macro recorder. Your new macro is now listed among your macros. You can run it directly, or if you're comfortable with VBA, you can open it in the VBA editor to modify it. You'll see the underlying code, which tells Word to delete a specific number of characters at the cursor position. If you accidentally had the macro delete too many or too few characters, it is easy to adjust this number.

For example, I discovered that deleting 12 characters was a bit too much, so I changed it to 11. After making that adjustment in the VBA code, I saved the changes and tested it again. Now, by clicking in front of any redundant image and hitting Ctrl-Shift-D, the macro removes the picture perfectly. I can now move quickly through a document, remove unnecessary images, and tidy things up in just a second.

That's not all you can do with macros. As a bonus example, imagine you're composing letters and you want to insert your standard signature block. You can record a macro that types out your closing, such as your name, email, and phone number. Assign it to a shortcut key, and the next time you want to use your signature, you simply use that shortcut and it appears instantly—saving even more time on repetitive tasks.

All of the keystrokes you record become part of your macro, and you can always fine-tune the steps by editing the macro in the VBA editor. Macros are perfect for automating routine actions in Word. We have just scratched the surface here, but I will be producing more comprehensive videos and an updated Word course that will cover macro recording and VBA in depth.

For now, this should help you take care of deleting those extra images quickly and efficiently. If you want more step-by-step instructions for everything discussed here, you can check out my complete video tutorial on my website at the link below.

Live long and prosper, my friends.
Topic List Enabling the Developer tab in Word

Customizing the Word ribbon to show Developer options

Using the Macro Recorder in Word

Assigning a macro to a keyboard shortcut

Recording a macro to delete characters in Word

Editing the number of characters deleted in a macro

Opening and editing macros in the VBA editor

Saving and closing the VBA editor in Word

Testing and adjusting a macro to delete images

Creating a macro to insert a signature block

Recording formatted text and line breaks with macros

Viewing and editing recorded macros in Word
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/12/2026 11:19:11 PM. PLT: 1s
Keywords: FastTips msword document with enter at the end of each line, Replace Line, Paragraph, Carriage Break in MS Word, How do I find and replace line breaks in Word, Removing Extra Breaks in Word Documents, removing carriage returns line breaks  PermaLink  How to Record a Macro to Delete Stuff in Microsoft Word Documents