www.multilingual.ch - English translations & proofreading - WWW Search Interfaces for Translators
Macro for inserting question marks around a word or phrase

 


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 question marks (??) around a word or phrase

What the macro does

This macro inserts two question marks around the word or phrase (??example??, ??second example??) that you have highlighted and is useful for marking terms that you are having trouble translating. The problem terms are easy to locate later on: simply search 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) **********

Dim theTerm As String
On Error GoTo MainStop
If Selection.Type = wdSelectionIP Then
MsgBox "You need to highlight a word or phrase first..."
Exit Sub
Else
theTerm = Selection.Text
End If
theTerm = Trim(theTerm)
With Selection.Font
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorYellow
End With
.Borders(1).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
Selection.TypeText Text:="????"
Selection.MoveLeft Unit:=wdCharacter, Count:=2
With Selection.Font
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
.Borders(1).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
Selection.TypeText Text:=theTerm
Selection.MoveRight Unit:=wdCharacter, Count:=2
With Selection.Font
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
.Borders(1).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
MainStop:
If Err.Number <> 0 Then
MsgBox "This macro inserts question marks around a word or phrase that you have highlighted. You need to highlight a term 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 "InsertQuery" 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

Highlight a word or phrase in Word, 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