Mobile menu

Macro to empty target segment?
Thread poster: Laure Trads

Laure Trads  Identity Verified
France
Local time: 21:22
Member (2004)
English to French
Mar 10, 2008

Hi,

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

Laure


Direct link Reply with quote
 

Sylvain Leray  Identity Verified
Local time: 21:22
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 ?

Sylvain

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]


Direct link Reply with quote
 

Laure Trads  Identity Verified
France
Local time: 21:22
Member (2004)
English to French
TOPIC STARTER
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.

Laure


Direct link Reply with quote
 

Johnny Speiermann
Denmark
Local time: 21:22
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:

Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Application.Run MacroName:= _
"TemplateProject.tw4winProtection.tw4winKeyDelete"
Selection.EscapeKey

(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 Normal.dot template. Otherwise it will be gone next time you start Word.


Direct link Reply with quote
 

Laure Trads  Identity Verified
France
Local time: 21:22
Member (2004)
English to French
TOPIC STARTER
It works like a charm! Mar 10, 2008

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

Laure


Direct link Reply with quote
 


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


Translation news related to SDL Trados





PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »
LSP.expert
You’re a freelance translator? LSP.expert helps you manage your daily translation jobs. It’s easy, fast and secure.

How about you start tracking translation jobs and sending invoices in minutes? You can also manage your clients and generate reports about your business activities. So you always keep a clear view on your planning, AND you get a free 30 day trial period!

More info »



All of ProZ.com
  • All of ProZ.com
  • Term search
  • Jobs