Questions? Feedback? powered by Olark live chat software

How to Run Useful Macros in Word

A Macro is a simple Visual Basic Code that Word "runs" on your document, performing specialized automated tasks. It's easy to implement and can save you a lot of time. The instructions that follow work for Word 2007

Open your document and enable the "Developer" tab on the ribbon

By default, the developer tab won't appear in Word. To enable it, click on the "Office" button, then on Word Options.

Check the box next to "Show Developer tab in the Ribbon," then click OK.

Open the Visual Basic Editor

Press ALT+F11 on your keyboard to open the Visual Basic Editor. This program looks complicated, but we are only going to scratch the surface of it, so don't fret.

Insert a New Module

Click on "Insert" and then "Module," and a blank window will appear. The Module is a text box that acts as the parameters for the small program that we will be running our document through. Paste the Macro code into this window. For a list of useful macros, scroll to the bottom of this lesson.

Run the Macro

Lastly, click the "Play" button on the menu bar or press the F5 key on your keyboard to run the script on your document. And you're done! You can close the Visual Basic editor if you don't' want to run any more scripts/macros.

Useful Macros - Select all Tables within your document

Sub selecttables()

Dim mytable As Table

Application.ScreenUpdating = False

For Each mytable In ActiveDocument.Tables

mytable.Range.Editors.Add wdEditorEveryone

Next

ActiveDocument.SelectAllEditableRanges (wdEditorEveryone)

ActiveDocument.DeleteAllEditableRanges (wdEditorEveryone)

Application.ScreenUpdating = True

End Sub

Useful Macros - Remove all Tables in your document, but keep the text

Sub AllTablestoText()

'

' AllTablestoText Macro

' Macro created by Jarosław Michalak

'

For Each aTable In ActiveDocument.Tables

aTable.ConvertToText wdSeparateByCommas, True

Next aTable

End Sub

Useful Macros - Delete all small images from your transcript

Sub DeleteSmallPictures()

Dim iShp As InlineShape

   For Each iShp In ActiveDocument.InlineShapes

       With iShp

           If .Width < CentimetersToPoints(5) Then

               iShp.Delete

           End If

       End With

   Next iShp

End Sub

Useful Macros - Widen all Tables in your document to the page margins

Sub AdjustTableWidth()

Dim oTable As Table

For Each oTable In ActiveDocument.Tables

With oTable

.PreferredWidthType = wdPreferredWidthPercent

.PreferredWidth = 100

End With

Next oTable

End Sub

If you continue to have problems or questions please email  support@qualboard.com. The comments on these articles are not published or monitored please email support@qualboard.com for further help.

Still need help? Email Tech Support Email Tech Support