It is possible with VBA (I assume you meant it as a Word macro?), but first I would try a different approach: just mark the first column of all tables. But for that I would have to be sure that it is always that particular column which needs to be marked...
If it is so, here's the macro:
Code:
|
Sub ExternalizeFirstColumn() ... See moreIt is possible with VBA (I assume you meant it as a Word macro?), but first I would try a different approach: just mark the first column of all tables. But for that I would have to be sure that it is always that particular column which needs to be marked... If it is so, here's the macro: Code:
|
Sub ExternalizeFirstColumn()
For Each aTable In ActiveDocument.Tables
aTable.Columns(1).Select
Selection.Style = "tw4WinExternal"
Next
End Sub
|
|
It works here, but of course try it out on a copy...
[Edited at 2009-02-27 19:39 GMT] ▲ Collapse |
|
Vito Smolej Německo Local time: 19:29 Člen (2004) angličtina -> slovinština + ... SITE LOCALIZER why not DO-NOT-TRANSLATE style | Feb 27, 2009 |
Hi Jan: what you want to do, is taken care of by DO NO TRANSLATE style. Just Mark all those texts you want unchanged as DO_NO_TRANSLATE. I do not know, however, how it looks, when you have to change the style back to the original - but that's the same problem also, when painting everything with tw4WinExternal. Or am I missing the point? The gut feeling is "you cant have a cake and eat it too": changing styles is what it says... | | |
Daniel Grau Argentina Člen (2008) angličtina -> španělština There is a problem with applying styles... | Feb 27, 2009 |
... and that is, the format of the text would be altered. It is better to apply an untranslatable attribute, such as Marching Red Ants, and then enable it in WF preferences. The macro would change from: Selection.Style = "tw4WinExternal" to: Selection.Font.Animation = wdAnimationMarchingRedAnts After translation (and/or cleanup), you do a Select All and choose Font > Animation > None. In this way, the source format is preserved. A ... See more ... and that is, the format of the text would be altered. It is better to apply an untranslatable attribute, such as Marching Red Ants, and then enable it in WF preferences. The macro would change from: Selection.Style = "tw4WinExternal" to: Selection.Font.Animation = wdAnimationMarchingRedAnts After translation (and/or cleanup), you do a Select All and choose Font > Animation > None. In this way, the source format is preserved. A further refinement would we to add a line below that one, stating: Selection.LanguageID = wdNoProofing so the spellckecker won't stop at this text. Daniel ▲ Collapse | |
|
|
Daniel Grau Argentina Člen (2008) angličtina -> španělština DELETED double post | Feb 27, 2009 |
[Edited at 2009-02-27 22:37 GMT] | | |
Jaroslaw Michalak Polsko Local time: 19:29 Člen (2004) angličtina -> polština SITE LOCALIZER Styles and not | Feb 27, 2009 |
The Red Ants trick works only with WordFast, so it will not be good for Trados (I'm not sure which Jan is using). If the appearance of the text matters, it is enough to change the properties of the tw4WinExternal style - Trados only looks at the style name, not at particular font properties. Besides, changing one style with another with Find and Replace is rather trivial... | | |
Daniel Grau Argentina Člen (2008) angličtina -> španělština You are right, it's a WF thing... | Feb 28, 2009 |
... and he does not list it among his software. As regards this: changing one style with another with Find and Replace is rather trivial... A global style replacement won't work if you have two different styles to restore, as in this case, unless you perform it one-by-one. Daniel | | |
Jan Sundström Švédsko Local time: 19:29 angličtina -> švédština + ... AUTOR TÉMATU You can't search for background colour :-( | Mar 3, 2009 |
Jabberwock wrote: Besides, changing one style with another with Find and Replace is rather trivial... Vito wrote: Just Mark all those texts you want unchanged as DO_NO_TRANSLATE. Hi all, Thanks a lot for your suggestions so far. Like Vito guessed however, I'm afraid most of you missed the point! My problem again: I have over 50 separate tables in each Word doc. I know how to mark each table individually and apply a style (or apply hidden text). But I'd have to do it 50 times over every time I get a new file. That's why I'd prefer a macro. I know how to search/replace in Word based on Pattern Matches (replace one colour with another colour, replace italics with bold, replace one style with another style). BUT: the problem is that Word doesn't allow searching for background colour! Check it for yourself, I could hardly believe it when I assumed to find the function and it was absent in the search window. /Jan | |
|
|
Jaroslaw Michalak Polsko Local time: 19:29 Člen (2004) angličtina -> polština SITE LOCALIZER The macro is right there... | Mar 3, 2009 |
The macro I have given before allows to select the first column of every table and apply the style you want. Automatically, no manual searching required. The other comments concerned the case when you need to restore the formatting of the source, if it changes (although I believe it is not relevant in this case). | | |
Jerzy Czopik Německo Local time: 19:29 Člen (2003) polština -> němčina + ... Do not use styles | Mar 3, 2009 |
but just hidden text formatting and translate in Tageditor. If you do so, the only action you need after the translation is done is unhide the text. This way you can prevent Tageditor from accessing the text which should not be translated, but don't change the formatting of it. When you unhide it the formatting is exactly as it was before. | | |
Jaroslaw Michalak Polsko Local time: 19:29 Člen (2004) angličtina -> polština SITE LOCALIZER
If you prefer to hide the text instead of styling, replace the line: Selection.Style = "tw4WinExternal" with: Selection.Font.Hidden = True However, if different font properties are used within the cells, they might be made the same. Macros are somewhat inconsistent in this respect. | | |