Pages in topic:   [1 2] >
A macro to go to the previous segment in Word...
Thread poster: Grzegorz Gryc

Grzegorz Gryc  Identity Verified
Local time: 21:30
French to Polish
+ ...
Aug 16, 2008

Hi

I wrote this simple macro in 5 (FIVE) minutes.

It's not perfect, but It works pretty well as Set/Close Previous Open/Get.
In fact, it calls the existing Trados macros for Word, so don't tell me the Trados programmers need several years to develop something like this.

See below
Copy the text between the ===begin and ===end lines (without these lines).
Open Word
Open the Visual Basic Editor (Alt+F11)
Select a template you prefer (e.g. Normal.dot but you can create your own template)
Right-click and select Insert Module.
Paste the macro code in the window.
Save.

You can assign a shortcut you prefer in Word (menu Tools/Customize/Keyboard, select the Macros in the Categories).
Please, remember, Alt+Num - you think natural is not available because it's handled by Word (it opens the main menu). so I propose Alt+Shift+Num+.

Enjoy.

Cheers
GG

=========================== begin
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
=========================== end


Direct link Reply with quote
 

Claudia Alvis  Identity Verified
Peru
Local time: 14:30
Spanish
+ ...
Done Aug 16, 2008

Thank you Grzegorz. This is a very useful macro.

Have a great weekend.

Claudia


Direct link Reply with quote
 

Heinrich Pesch  Identity Verified
Finland
Local time: 22:30
Member (2003)
Finnish to German
+ ...
The macro from Yves exists since years Aug 17, 2008

In the Wordfast manual the author of Wordfast has provided a macro for this since years. In Wordfast it was always possible to go back without stopping the process.

I don't know why the Trados-package does not include this function. It seems to be conscious disregard for the needs of the user. As long as we buy or update there product anyway they don't have to listen to our needs.

Regards
Heinrich

[Bearbeitet am 2008-08-17 08:22]


Direct link Reply with quote
 

Sandra& Kenneth  Identity Verified
Israel
Local time: 22:30
Member (2009)
French to English
+ ...
Thanks Grzegorz, this is a "must have" add-on Aug 19, 2008

Hi Grzegorz

Thanks a lot! Your macro works like a charm. I wonder how come nobody has thought of it earlier.

I chose the shortcut Alt+Shift+Num- since minus is more intuitive for "going back".

Keep up the good work!
Sandra


Direct link Reply with quote
 

Sandra& Kenneth  Identity Verified
Israel
Local time: 22:30
Member (2009)
French to English
+ ...
Copyright it Aug 20, 2008

Hi Grzegorz,

I think you should copyright this macro ASAP, i.e. insert a copyright notice in title. Otherwise you may see it included in the next Trados version and advertised as a new improvement.
I don't think that will make you happy.
Just a thought...
Sandra


Direct link Reply with quote
 

Owen owenfw
Local time: 13:30
Finnish to English
+ ...
Error Jan 29, 2009

Using Word 2007, I get an error "Runtime error 449: Argument not optional". If I debug it sends me to the line Application.Run MacroName:="tw4winSetClose.Main".

Any VB experts out there who can help?


Direct link Reply with quote
 

Stanislav Pokorny  Identity Verified
Czech Republic
Local time: 21:30
English to Czech
+ ...
Highly appreciated indeed Jan 30, 2009

Hi Grzegorz,
a thousand thank-yous!!!
I don't know why it takes SDL Intl. such a long time to add this feature. Maybe designing and creating a new button for the Trados toolbar is the problem.

I second Sangro's post: include a copyright notice immediately. If you don't, somebody else will.


Direct link Reply with quote
 

Grzegorz Gryc  Identity Verified
Local time: 21:30
French to Polish
+ ...
TOPIC STARTER
Patience, please... :) Jan 30, 2009

Owen Witesman wrote:

Using Word 2007, I get an error "Runtime error 449: Argument not optional". If I debug it sends me to the line Application.Run MacroName:="tw4winSetClose.Main".

Any VB experts out there who can help?


The macro was written in Word 2003.
I'll take a look on W2007.
I know important changes were made in the macro language but it should be simple.

Cheers
GG


Direct link Reply with quote
 

Grzegorz Gryc  Identity Verified
Local time: 21:30
French to Polish
+ ...
TOPIC STARTER
A proof of concept :) Jan 30, 2009

Stanislav Pokorny wrote:

Hi Grzegorz,
a thousand thank-yous!!!
I don't know why it takes SDL Intl. such a long time to add this feature. Maybe designing and creating a new button for the Trados toolbar is the problem.

As all the buttons were revamped in the 2007 version (a huuuuuge improvement in the user experience...), I don't think it's the reason

I second Sangro's post: include a copyright notice immediately. If you don't, somebody else will.

The programming is too poor.
This macro is only a kinda proof on concept
I.e. even a dummy can do it in 5 (five) minutes, no knowledge at all is needed.
You must only want to do it.

It applies to SDL too.
They must only want to do it.
They simply don't want to make it.
The priority is the new look of the toolbar

Cheers
GG


Direct link Reply with quote
 

Stanislav Pokorny  Identity Verified
Czech Republic
Local time: 21:30
English to Czech
+ ...
:) Jan 30, 2009

Can't but agree...

Direct link Reply with quote
 

IanDhu  Identity Verified
France
Local time: 21:30
Member (2005)
French to English
Button design Feb 6, 2009

... Maybe designing and creating a new button for the Trados toolbar is the problem.


Shall we have a button-design contest? We'll call it the "Grzegorz":-)

And yes, well done; do collar the copyright to your macro before someone else does!

With many thanks and kind regards,

Adam (IanDhu)


Direct link Reply with quote
 

Grzegorz Gryc  Identity Verified
Local time: 21:30
French to Polish
+ ...
TOPIC STARTER
Version for Word 2007 Feb 6, 2009

Grzegorz Gryc wrote:

Owen Witesman wrote:

Using Word 2007, I get an error "Runtime error 449: Argument not optional". If I debug it sends me to the line Application.Run MacroName:="tw4winSetClose.Main".

Any VB experts out there who can help?


The macro was written in Word 2003.
I'll take a look on W2007.
I know important changes were made in the macro language but it should be simple.


It was, indeed
The SDL macro names were modified in the Wiird 2007 template.

=========================== begin
Sub Scheiss4winSetCloseGetPreviousExisting2007()

' Scheiss4winSetCloseGetPreviousExisting
' Macro created by Grzegorz Gryc, damn furious against
' the slooooooow Trados programmers
' Version for MS Word 2007
'
Application.Run MacroName:="TemplateProject.tw4winSetClose.Impl"
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:="TemplateProject.tw4winOpenGet.Impl"
End Sub
=========================== end

BTW.
See another one proof of the SDL messy programming.
As my macro invokes SDL macros, you can see the SDL macro names here.
The bastards are even unable to replace the default TemplateProject name by SDL or Tw4Win or something like this and make a little bit of order...

Cheers
GG

[Edited at 2009-02-06 09:51 GMT]


Direct link Reply with quote
 

Owen owenfw
Local time: 13:30
Finnish to English
+ ...
It works! Feb 6, 2009

Brilliant! Thanks.

I wonder if it would be possible to make it work on empty segments? So like you go to the next segment, but then realize you want to go back, but haven't entered a translation for the segment you are on...

I would disagree on one point: some knowledge is needed! Thank you for sharing yours.


Direct link Reply with quote
 

Grzegorz Gryc  Identity Verified
Local time: 21:30
French to Polish
+ ...
TOPIC STARTER
Going back from an empty segment... Feb 8, 2009

Owen Witesman wrote:

Brilliant! Thanks.

I wonder if it would be possible to make it work on empty segments? So like you go to the next segment, but then realize you want to go back, but haven't entered a translation for the segment you are on...

As I'm an idiot, I'm unable to give you a clean solution, so I wrote another macro for empty segments

=========================== begin
Sub Scheiss4winSetCloseGetPreviousFromEmpty2007()

' Scheiss4winSetCloseGetPreviousFromEmpty2007
' Macro created by Grzegorz Gryc, damn furious against
' the slooooooow Trados programmers
' Version for MS Word 2007'
'
Application.Run MacroName:="TemplateProject.tw4winRestoreSource.Impl"
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
Application.Run MacroName:="TemplateProject.tw4winOpenGet.Impl"
End Sub
=========================== end

I would disagree on one point: some knowledge is needed!

Ehm...
Although I see the the algotrithm but I'm not a programmer, I'm unable to write a clean working conditionnal procedure in a breeze... :|

Thank you for sharing yours.

Ehm...
At this level, it's really simple.
A true masterpiece is the CodeZapper by David Turner.
Just google it.
A must for OCR-ed files.

PS.
Starting a flame war about the DVX superiority
No problem at all to go to the previous segment
The same with Wordfast, Swordfish etc.

Cheers
GG

[Edited at 2009-02-08 01:56 GMT]


Direct link Reply with quote
 

Grzegorz Gryc  Identity Verified
Local time: 21:30
French to Polish
+ ...
TOPIC STARTER
SDL™ Donald™ Duck™ macro™ case ;P Feb 8, 2009

IanDhu wrote:

... Maybe designing and creating a new button for the Trados toolbar is the problem.


Shall we have a button-design contest? We'll call it the "Grzegorz":-)

Perhaps, perhaps, perhaps
Sometimes I think I'll publish a little set of macros for some functions I'm terribly missing in Trados... but I'm too lazy...
Normally I don't need 'em as I work mainly in DVX ans I have all these shortuts out of the box

And yes, well done; do collar the copyright to your macro before someone else does!

I hope it's so evident like the Donald Duck prior art case
If the macro is copyrighted by someone else, it has no f!@#$..g effect

http://www.iusmentis.com/patents/priorart/donaldduck

Cheers
GG

[Edited at 2009-02-08 12:34 GMT]


Direct link Reply with quote
 
Pages in topic:   [1 2] >


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


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

A macro to go to the previous segment in Word...

Advanced search







CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »
Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »



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