strange behaviour of Word tables in Trados
Thread poster: Antoní­n Otáhal

Antoní­n Otáhal
Local time: 12:43
Member (2005)
English to Czech
+ ...
Mar 6, 2005

When translating tables in MS word using Trados (Word 2002, Trados 6.5 FL), sometimes the original is not chaned into "hidden" text and the font in such cells behaves in a strange way. Since I spent some time on the problem and have found a partial solution which works for me, I am putting here a MS Word macro (VBA) which can be used to preprocess the tables so that the "bad" styles (which, as far as I can tell, are responsible for the behaviour) can be removed from the tables while preserving (more or less) all other fatures of the text.

Any commments or advice on how to improve the solution will be most welcome.

*** begin macro ***

Sub preprocess_tables_for_trados()
'It will go through the selection and, in each table within this selection, it will remove styles
'which prevent Trados from proper processing of the tables
'while preserving - in each cell separately - the font name, size and colour; bold, italic and underline;
'and alignment of the cell (left, right, centered or justified)
'I have not tested it on tables in which different fonts, colours, sizes etc. are mixed in one cell
'- it would be complicated and I do not have to cope with such wild tables too often, if ever

'remember the selection as a range
Set rnng = Selection.Range
'how many tables are there in the selection?
tbn = rnng.Tables.Count
'Cycle through tables
For m = 1 To tbn
'Count columns and rows in the m-th table:
cj = rnng.Tables(m).Columns.Count
cr = rnng.Tables(m).Rows.Count
'Cycle through the cells in the m-th table:
For j = 1 To cj
For k = 1 To cr
'Even if some cells are merged, and therefore some other cells are missing,
'we do not want to stop on the missing cells:
On Error Resume Next
'so if the "rnng.Tables(m).Cell(k, j)" cell does not exist, we "resume" and go on anyway:
rng = rnng.Tables(m).Cell(k, j)
'but, if it is the case, we have to skip the action and go to the "emptyrun" label:
If Err.Number = 5941 Then GoTo emptyrun
'read properties of cells formatting:
txxt = rng.Font.Name
szze = rng.Font.Size
clit = rng.Italic
clbd = rng.Bold
clul = rng.Underline
algt = rng.ParagraphFormat.Alignment
clru = rng.Font.Color
'select the cell:
'clear format of the cell:
'put back into the cell its orginal formatting properties:
rng.Font.Name = txxt
rng.Font.Size = szze
rng.Italic = clit
rng.Bold = clbd
rng.Underline = clul
rng.ParagraphFormat.Alignment = algt
rng.Font.Color = clru
'here is the label to which the "mising cell" error jumps:
'counting indices in cycles:
Next k
Next j
Next m

End Sub

*** end macro ***

[Edited at 2005-03-06 08:29]

Direct link Reply with quote
Thank you May 6, 2005

Thank you I will certainly try

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 »

strange behaviour of Word tables in Trados

Advanced search

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 »
You’re a freelance translator? 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
  • Term search
  • Jobs
  • Forums
  • Multiple search