Macro to empty target segment?
Thread poster: Laure Trads

Laure Trads  Identity Verified
Local time: 13:59
Member (2004)
English to French
Mar 10, 2008


In Workbench, I was wondering how to write a macro in Word which would allow me to empty the target segment when I do not want to use the suggested translation.
Something like:
- select segment content up to paragraph mark
- delete selection



Sylvain Leray  Identity Verified
Local time: 13:59
Member (2003)
German to French
Copy source if no match Mar 10, 2008

Hi Laure,

Doesn't the option "Copy source if no match" fit your needs ? Do you really want an empty segment ?


Edit : oops, sorry, I replied too quickly... you can use the "Copy source" as an alternative (Alt + Ins with a French keyboard)...

[Modifié le 2008-03-10 11:39]


Laure Trads  Identity Verified
Local time: 13:59
Member (2004)
English to French
I do want an empty segment Mar 10, 2008

Hi Sylvain,

This is for cases when nothing in the matching segments can be used. When this happens, I want to avoid, every single time, to have to select and delete the content of the segment in order to type my translation. It is an amazing waste of time when you repeat that operation all day. A few years ago, another translator had told me of a macro she had created to do exactly that (delete all text up to the paragraph mark), but I remember how to do it.



Johnny Speiermann
Local time: 13:59
English to Danish
+ ...
Macro Mar 10, 2008

Hi Laure,

You can use this macro (at your own risk, but it worked for me in a short test):

1. Open Word.
2. Select Tools > Macro > Macros, type a macro name, and click Create.
3. Paste the following macro into the Microsoft Visual Basic window:

With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Application.Run MacroName:= _

(This macro simply extends the selection, finds the paragraph mark, goes one character to the left to deselect the paragraph mark, and then deletes the selection.)

4. Close the Microsoft Visual Basic window.
5. Assign a shortcut to the macro.

Assigning a shortcut to a macro:
1. Rightclick a toolbar in Word, and select Customize.
2. Click the Keyboard button.
3. Select Macros in the list Categories on the left.
3. Click the macro on the list on the right (has the name you entered in step 2 above).
4. Click in the field Press new shortcut key.
5. Press a new shortcut key, for example Ctrl+G. You will get a warning, if the shortcut is already used.)
6. Click Assign.

Exit Word to save the macro in the template. Otherwise it will be gone next time you start Word.


Laure Trads  Identity Verified
Local time: 13:59
Member (2004)
English to French
It works like a charm! Mar 10, 2008

This is exactly what I was looking for.
Thank you "Word Gallery"!



To report site rules violations or get help, contact a site moderator:

You can also contact site staff by submitting a support request »

Macro to empty target segment?

Advanced search

memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

More info »
WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »

  • All of
  • Term search
  • Jobs
  • Forums
  • Multiple search