Mobile menu

Macro to empty target segment?
Thread poster: Laure Trads

Laure Trads  Identity Verified
France
Local time: 22:31
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: 22:31
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 ?

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: 22:31
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: 22:31
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: 22:31
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





Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »
Across v6.3
Translation Toolkit and Sales Potential under One Roof

Apart from features that enable you to translate more efficiently, the new Across Translator Edition v6.3 comprises your crossMarket membership. The new online network for Across users assists you in exploring new sales potential and generating revenue.

More info »



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