Trados - How to go to the previous segment using a macro and assigning a key to it

zephyrous

  • Hero Member
  • *****
    • Posts: 3698
    • Gender:Male
A macro can actually make Trados behave Wordfast-like in this respect (this macro can be assigned to Alt+Up or Alt+Numeric Substract). Here it is:

Code: [Select]
Sub tw4winOpenPrevious()
'by Yves Champollion
Dim Here As Long

Application.ScreenUpdating = False

If Not ActiveDocument.Bookmarks.Exists("tw4winFrom") Then
MsgBox "No Trados session in progress!"
Exit Sub
End If

With Selection.Find
.ClearFormatting
.MatchWildcards = False
.MatchWholeWord = False
End With

Here = ActiveDocument.Bookmarks("tw4winFrom").Start

Selection.SetRange Here, Here
If Not Selection.Find.Execute(findtext:="^p<0}", Forward:=True) Then Exit Sub
Here = Selection.Start
Application.Run "tw4winSetClose.Main"
Selection.SetRange Here, Here

If Selection.Find.Execute(findtext:="{0>", Forward:=False) Then
Selection.Collapse
If Selection.Find.Execute(findtext:="{0>", Forward:=False) Then
Selection.Collapse
Application.Run "tw4winOpenGet.Main"
Exit Sub
End If
End If

MsgBox "Sorry, no previous segment!"
End Sub



To include this macro into your Normal.dot: Use the Tools/Macros/Visual basic Editor menu. A new window opens. Double-click “Normal” on the left side, then “Modules”. If no module is present, use the Insertion/Module menu to add a code module. Double-click the code module. In the right side, where the code module opens up, paste the macro above.

To associate this macro with Alt+Up: Back in Ms-Word, use the View/Toolbars/Customize dialog box. Click “KeyBoard” then in “Categories”, select “Macro”, then select the tw4winOpenPrevious macro. In “New shortcut”, type Alt+Up then click “Assign and close the dialog box.


Keywords: tw4winOpenPrevious, open previous segment, open previous, Trados, macro.
« Last Edit: 13 Oct, 2008, 12:24:46 by spiros »


zephyrous

  • Hero Member
  • *****
    • Posts: 3698
    • Gender:Male
Να σημειώσω μόνο ότι έχει δοκιμαστεί με επιτυχία τόσο στο Trados 6.5, όσο και στο SDL Trados 2006. ;)



spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 854558
    • Gender:Male
  • point d’amour
Ναι, δουλεύει (Trados 7)!

Και που σκεφτόμουνα, «βρε δεν γίνεται μια μακροεντολή να κάνει αυτό το πράγμα;» (Δεδομένης της χρήσης του από Wordfast / MetaTexis). Είναι απίστευτο, πόσα απλά πράγματα, που διευκολύνουν τη ζωή του χρήστη, έχουν παραλειφθεί από το Trados...


stathis

  • Hero Member
  • *****
    • Posts: 3372
    • Gender:Male
Είναι απίστευτο, πόσα απλά πράγματα, που διευκολύνουν τη ζωή του χρήστη, έχουν παραλειφθεί από το Trados...

Αρχίσατε πάλι την αντιπολίτευση;

:))



spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 854558
    • Gender:Male
  • point d’amour

spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 854558
    • Gender:Male
  • point d’amour
Και να μην ξεχνάμε και αυτήν τη μακροεντολή:

Paste Unformatted Macro - Copy easily from Trados Concordance into Word
https://www.translatum.gr/forum/index.php?topic=434.0
« Last Edit: 09 Dec, 2006, 21:18:35 by spiros »


spiros

  • Administrator
  • Hero Member
  • *****
    • Posts: 854558
    • Gender:Male
  • point d’amour
And here is another macro doing the same thing (unfortunately, none of them works properly in my configuration).
Code: [Select]
Sub Scheiss4winSetCloseGetPreviousExisting()

' Scheiss4winSetCloseGetPreviousExisting
' Macro created by Grzegorz Gryc, damn furious against
' the slooooooow Trados programmers

Application.Run MacroName:="tw4winSetClose.Main"
Selection.Find.ClearFormatting
With Selection.Find
.Text = "{0>"
.Replacement.Text = ""
.Forward = False
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute
Application.Run MacroName:="tw4winOpenGet.Main"
End Sub

http://www.proz.com/forum/sdl_trados_support/112859-a_macro_to_go_to_the_previous_segment_in_word.html


 

Search Tools