www.multilingual.ch - English translations & proofreading - WWW Search Interfaces for Translators
MS Word macro for inserting comments or queries in a Word document

 


The macro below works in MS Word 2002

 

Once you have installed the macro below, you will need to add a macro button in your toolbar or in your right-click menu to run the macro.

 

Macro for inserting a comment or query ({{...}}) in a Word document

What the macro does

This macro inserts {{...}} at the location of the cursor so that you may enter a comment or query which will be easy to locate later on (example: Harvej{{check spelling of this name}}). This can be useful when you need to send comments/queries to the author of the text that you are translating. The comments and queries may also be located by searching for "{{".

How to set up the macro

1. Select and copy the text of the macro shown below: Copy only the material that appears between the lines of asterisks; DO NOT copy extra blank lines or the asterisks themselves.

**********cut here (do not include this line) **********

On Error GoTo MainStop
' If text is currently highlighted
If Selection.Type <> wdSelectionIP Then
' Unhighlight
Selection.MoveRight Unit:=wdCharacter, Count:=1
End If
Selection.TypeText Text:="{{}}"
Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
With Selection.Font
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorYellow
End With
.Borders(1).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=2
MainStop:
If Err.Number <> 0 Then
MsgBox "This macro inserts a comment or query at the location of your cursor. You need to place your cursor in the right location of your text first..."
End If

**********cut here (do not include this line) **********

2. In the menu bar at the top of your window in Word, click on the Tools menu. Click on Macro, then on Macros in the sub-menu.

3. The Macros dialog box will open. Type the name "AddComment" for the macro in the "Macro name:" field.

4. Click the Create button.

5. A window titled "Microsoft Visual Basic – Normal – [New Macros (Code)]" will open. In the window that appears, find the line of text that reads: Macro created [Today’s Date] by [Your Name]

6. Paste the macro lines that you copied in Step 1 into the Visual Basic window, at the spot where the input cursor is blinking.

7. Save your macro by clicking the Save button (diskette icon) on the toolbar.

8. Close the whole Visual Basic window. Your macro is now installed.

9. Add a macro button in your toolbar or in your right-click menu to run the macro.

 

How to run the macro

Place your cursor in the location where you would like to enter a comment or query to the author, click on the macro button in your toolbar or select the macro from your right-click menu.

 

 

Print this page!

 

Back / Tools for Translators / Home / Site Map

http://www.multilingual.ch
Web design by Tanya Harvey Ciampi