Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • How to Change the Cursor on Windows 10 Windows 10
  • How to Disable Adobe Flash in Microsoft Edge on Windows 10 Windows 10
  • 6 Simple Hacks To Access Blocked Websites How-To
  • How to Convert a PDF File to Word, Excel or JPG Format Computer Tips
  • What Is Steam Broadcasting and How to Set It Up Gaming
  • How to Access Your Android From Computer Using SSH [No ROOT] How-To
  • Microsoft Teams vs Zoom, which is better now? Software Reviews
  • how to connect wii to smart tv Computer Tips

How to create and run a macro in MS Word

Posted on June 21, 2023June 21, 2023 By blog_786 No Comments on How to create and run a macro in MS Word

How to create and run a macro in MS Word.

If you work a lot with Microsoft Word and do the same thing all the time, create a macro. Macro is short for macroinstruction, which means a series of instructions to complete a task.

The great thing about creating macros in Word is that you don’t need to know how to program. If you can hit the record button and stop, you can do it.

How to create and run a macro in MS Word

Aren’t Macros Dangerous?

Have you heard that macros are bad because they can contain viruses? While you should be careful when opening Office documents from unknown people as they may contain malicious macros, this is not a problem here. You make your own macro to know that it is not a virus.

How To Record A Macro in Word

In this example, you are going to create a macro in Word to insert your signature at the end of the document.

  1. With Word open, click the View tab.
  2. Click the down arrow below the Macros button.
  3. Select Record Macro … a new window will open.

How to create and run a macro in MS Word

  1. In the Macro name: field, enter a meaningful name for the macro. Spaces are not allowed. Use underscore or dash.
  2. In the “Save Macro To:” drop-down list, you can choose which documents you want to use for this macro. If you select All Documents (Normal.dotm), the macro will be available to you in every new Word document that you create from now on. If you select one document, it will only apply to that single document. It is usually best to select “All Documents”.

How to create and run a macro in MS Word

  1. In the Description: field, specify what the macro does. This is a simple macro with a descriptive name, but as you get more comfortable with the macros, you will tackle more complex tasks, so a description is always a good idea.
  2. You can select “Assign Macro” to any button. you create with a button or hotkeys that you can select with a keyboard button. There are many keyboard shortcuts already available for Word, so a button works best. Select button. A new window will open titled “Word Options”.

How to create and run a macro in MS Word

  1. This is where you assign a button to the macro on the Word ribbon. Select “Customize Ribbon”.
  2. From the Select Commands From: drop-down list, select Macros. This will show us our macros in the area below it.

How to create and run a macro in MS Word

  1. You need somewhere on the ribbon to place the macro. For this example, select Home in the Main Tabs area. Then select “New Group”.
  2. Select Rename to give it a meaningful name.
  3. In the Rename window, select one of the icons to represent the group, then enter My Macros in the Display Name field.
  4. Click OK to apply it. You will see the change in the main tabs area.

How to create and run a macro in MS Word

  1. With the new My Macros selected in the Main Tabs area, select the Normal.NewMacros.Insert_Signature macro.
  2. Select Add to add it to the My Macros group.

How to create and run a macro in MS Word

  1. Of course you want to rename it. With the macro selected in the Main Tabs area, select Rename ….
  2. In the Rename window, select the icon and enter a simple name in the Display Name: field.
  3. Click OK to commit the change. You will see the change in the main tabs area.
  4. Click OK below the main tabs area to complete the button for the macro.

How to create and run a macro in MS Word

  1. Create any signature block you want. Add a scan of your signature or other images. As you wish. When done, click the down arrow below the Macros button.
  2. Select Stop Recording. This is it. The signature insert macro has been created.

How to create and run a macro in MS Word

  1. Check this out by finding the Insert Signature button you created on the Home tab and select it. Your signature block should magically look exactly the way you created it.

How to create and run a macro in MS Word

How To Write a Macro

For most macros, recording is the most efficient way to create them. At the end of the day, you will want to do something more difficult. To do this, you must write a macro in Visual Basic for Applications (VBA). We’ve got the best beginner’s guide to VBA, so bookmark it. Let’s create a macro that will show us the average number of words in a sentence to help us determine when we are verbose.

  1. You need access to the Developer tab, which is hidden by default in Word. In the upper-left corner of Word, select File.

How to create and run a macro in MS Word

  1. In the lower left corner, select Options.

How to create and run a macro in MS Word

  1. In the window that opens, select “Customize Ribbon”.
  2. Find “Developer” on the right and check the box next to it.
  3. Select OK to close the window. The Developer tab will open.

How to create and run a macro in MS Word

  1. Select the Developer tab.
  2. Click the Macros button.

How to create and run a macro in MS Word

  1. Enter a meaningful name in the Macro Name field: leave the macro in: as Normal.dotm so that it applies to all Word documents. Always enter a description in the Description: area.
  2. Select New. The Microsoft Visual Basic for Applications Development Tool opens.

How to create and run a macro in MS Word

  1. The code shown in the green boxes below should already be there with a little space in between. Copy and paste the following code here:

Dim s As Range
Dim numWords As Integer
Dim numSentences As Integer
numSentences = 0
numWords = 0

– /

For each s in ActiveDocument.Sentences
numSentences = numSentences + 1
numWords = numWords + s.Words.Count
Next

MsgBox “Average number of words in a sentence” + Str (Int (numWords / numSentences)) + “. Less than 15 is best. ”

  1. Click the Run button to test the code. If it doesn’t work as expected, edit the code until it runs the way you want it to.

How to create and run a macro in MS Word

  1. Click the Save button and close the design window.

How to create and run a macro in MS Word

  1. Create a button on the Word ribbon using the same method shown in the How to Record Macro instructions above.
  2. Find the button you just created and check it out.

How to create and run a macro in MS Word

My Macro Doesn’t Work When I Save My Word Document

By default, Word saves the file with a .docx extension, which prevents macros from running automatically. If you want the macro to run, you need to change the file type to Word Macro-Enabled Document (* .docm).

This file type exists in part to combat macro security issues. If you see this file extension in a document that you did not expect to receive, be suspicious.

How to create and run a macro in MS Word

What Else Can I Do With Macros?

You can create macros in Excel, Outlook, and even PowerPoint. Anything you do manually now, you should be able to record or write a macro to do this. Using macros in Word along with the excellent Windows keyboard shortcuts will increase your productivity tenfold.

How to create and run a macro in MS Word

How to create and run a macro in MS Word

Share this:

  • Twitter
  • Facebook
Office Tips Tags:Arenrsquot Macros Dangerous?, How to create and run a macro in MS Word, How To Record A Macro in Word, How To Write a Macro, My Macro Doesnrsquot Work When I Save My Word Document, What Else Can I Do With Macros?

Post navigation

Previous Post: Have a great time with seven great virtual dates
Next Post: 100 Most Useful GIMP Keyboard Shortcuts

Related Posts

  • How to Trace Dependents in Excel Office Tips
  • What Is Microsoft 365? Office Tips
  • How To Create a VBA Macro Or Script In Excel Office Tips
  • Check All Hyperlinks in a MS Word Document in Seconds Office Tips
  • How To Insert An Animated GIF In PowerPoint Office Tips
  • Insert a Bullet in the Middle of a Sentence in Word Office Tips

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • Flixable Helps You Find the Best Movies and TV shows on Netflix
  • How to Watch Winter Olympics 2018 from Anywhere
  • Why does Instagram say this story is unavailable?
  • How to turn off Do Not Disturb mode on Android
  • 3 Sites like YouTube to Earn Money With Your Videos
DMCA.com Protection Status

Recent Posts

  • 15 Best Legal Torrenting Sites to Download Content Safely
  • Review of the ReMarkable 2.0 tablet with Type Folio keyboard
  • Flixable Helps You Find the Best Movies and TV shows on Netflix
  • How to Watch Winter Olympics 2018 from Anywhere
  • 5 Sites That Are Like Audible, But Free

Recent Comments

  1. Flixable Helps You Find the Best Movies and TV shows on Netflix on SmartDNS vs VPN “What’s the Difference?”
  2. 5 Sites That Are Like Audible, But Free on Top 4 Amazon Price Tracker Tools
  3. 5 Sites That Are Like Audible, But Free on 14 Best Free Audiobooks on Audible – 2022
  4. How to Reduce PNG File Size of a Photo on How to Convert a Screenshot to a Jpeg on a Mac
  5. 3 Sites like YouTube to Earn Money With Your Videos on Here are the Top 10 highest paid YouTubers of 2013
  • The New Non-Programmable Scientific Calculator 2020 Calculator
  • The Best Portable Projector for Watching Movies Gadgets
  • Enable Microphone, Line-In Audio, and Stereo Mix in Windows How-To
  • 100 Most Popular Internet slangs that Everyone should know How-To
  • How To Restore Accidentally Deleted Digital Files How-To
  • Add Google Maps Driving Directions to Your Website Google Software/Tips
  • Top 10 YouTube Programming Learning Channels 2022 Cool Websites
  • 10 MacBook Pro Tips for Beginners Hardware

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version