Copy all paragraphs underneath each other in MS Word Автор темы: Alex Lago
| Alex Lago Испания Local time: 07:50 английский => испанский + ...
I'm doing a job on an MS Word file, the job calls for placing the translation for each paragraph underneath the original paragraph in between brackets [] and in bold and italics leaving the original paragraph on top.
I prefer working with a CAT tool so I was wondering if anyone knows what macro I could set up in Word to do the following:
1- Copy each paragraph underneath itself in between brackets and in bold and italics.
2- Then make the original paragraph... See more I'm doing a job on an MS Word file, the job calls for placing the translation for each paragraph underneath the original paragraph in between brackets [] and in bold and italics leaving the original paragraph on top.
I prefer working with a CAT tool so I was wondering if anyone knows what macro I could set up in Word to do the following:
1- Copy each paragraph underneath itself in between brackets and in bold and italics.
2- Then make the original paragraph hidden so it doesn’t show up in the CAT TOOL.
Any help would be much appreciated as I've no idea how to go about this but I think it is possible. ▲ Collapse | | | Samuel Murray Нидерланды Local time: 07:50 Член ProZ.com c 2006 английский => африкаанс + ...
Alex Lago wrote:
I'm doing a job on an MS Word file, the job calls for placing the translation for each paragraph underneath the original paragraph in between brackets [] and in bold and italics leaving the original paragraph on top.
If your file has no tables, then... instead of a macro, how about this: Convert the entire document to a 1-column table, and then duplicate the column. Translate that column in your CAT tool. Then insert the translated column next to the source text column. Format both columns the way you want them. Then convert the table to text, with the "paragraph" option.
Any help would be much appreciated as I've no idea how to go about this but I think it is possible.
It's a bit tricky because the macro recorder can't "record" hidden and bold/italics.
Try this one (but make sure you search afterwards for accidentally doubled { and } and [ and ]). | | | Tuan Dzung Вьетнам Local time: 13:50 Член ProZ.com c 2014 английский => вьетнамский + ... Transtools may be suitable for you | Nov 11, 2014 |
Dear Alex,
- Download "Transtools for Word" from here:
http://www.translatortools.net/
- Use "Dual-language document assistant" to create highlight colour (yellow, for example) for source text/paragraph.
- Then use Hide/unhide text of Transtools to hide source text/paragraph.
- Import to CAT tool.
[Đã chỉnh sửa 2014-11-11 06:56 GMT] | | | esperantisto Local time: 09:50 Член ProZ.com c 2006 английский => русский + ... ЛОКАЛИЗАТОР САЙТА More specific | Nov 11, 2014 |
Alex Lago wrote:
I prefer working with a CAT tool
You should be more specific on the CAT tool of your preference. In such a case, perhaps, advise could be more detailed.
If the tool supports export of a TM for a particular file, do:
- export a TMX file for the document;
- convert it to CSV using any suitable tool such as Okapi Olifant;
- load it to Word and convert text to table;
- apply bold/italic to the column with translations;
- convert the table to tab-delimited text;
- find and replace ^p with ]^p;
- find and replace ^t with ^p^t[;
- done.
If the tool supports export to two-column text, start from the step 3. | |
|
|
Alex Lago Испания Local time: 07:50 английский => испанский + ... Автор темы Thanks for the suggestions | Nov 11, 2014 |
Thank you all for the suggestions, this is what I ended up doing:
1- Replace all paragraph with ]paragraph[, which in Word was replace "^p" with "]^p[", which gave me a brackets at the end and beginning of every paragraph.
2- Put the start bracket "[" on the first paragraph and the end one "]" on the last paragraph
3- Convert text to 1 column table
4- Copy the text to a second column
5- Remove the brackets from the text in column one by simply replacing them ... See more Thank you all for the suggestions, this is what I ended up doing:
1- Replace all paragraph with ]paragraph[, which in Word was replace "^p" with "]^p[", which gave me a brackets at the end and beginning of every paragraph.
2- Put the start bracket "[" on the first paragraph and the end one "]" on the last paragraph
3- Convert text to 1 column table
4- Copy the text to a second column
5- Remove the brackets from the text in column one by simply replacing them with nothing ( in two steps, first removing "[" and then "]").
6- Make the text in the second column bold and italics
7- Make the text in column one hidden (so the CAT tool, Wordfast, does not see it).
8- Translate the file and prepare translated Word file.
9- Make all hidden text not hidden
10- Merge all the cells in the table into one single cell (this puts the text in column 2 under the corresponding text in column 1)
11- Copy the text in the table outside the table and delete the table. ▲ Collapse | | | Minh Nguyen Вьетнам Local time: 13:50 английский => вьетнамский | Alex Lago Испания Local time: 07:50 английский => испанский + ... Автор темы Thanks linhdan | Nov 12, 2014 |
Thanks for sending the app | | | a macro just from the oven | Nov 12, 2014 |
Alex you can try that:
Sub SmartDoubling()
Dim Para As Paragraph
Dim ParaIx As Long
Dim r As Range
Dim text As String
ParaIx = 0
Dim Count As Long
Count = ActiveDocument.Paragraphs.Count * 2
Do
ParaIx = ParaIx + 1
Set r = ActiveDocument.Paragraphs(ParaIx).Range
text = Mid(r.text, 1, Len(r.text) - 1)
r.Font.Hidden = True
r.text = text & vbCrLf & "[" & text & "]" & vbCrLf
ParaIx = Pa ... See more Alex you can try that:
Sub SmartDoubling()
Dim Para As Paragraph
Dim ParaIx As Long
Dim r As Range
Dim text As String
ParaIx = 0
Dim Count As Long
Count = ActiveDocument.Paragraphs.Count * 2
Do
ParaIx = ParaIx + 1
Set r = ActiveDocument.Paragraphs(ParaIx).Range
text = Mid(r.text, 1, Len(r.text) - 1)
r.Font.Hidden = True
r.text = text & vbCrLf & "[" & text & "]" & vbCrLf
ParaIx = ParaIx + 1
Loop While ParaIx < Count
ParaIx = 0
For Each Para In ActiveDocument.Paragraphs
ParaIx = ParaIx + 1
Set r = Para.Range
If ParaIx Mod 2 = 0 Then
r.Font.Italic = True
r.Font.Bold = True
r.Font.Hidden = False
End If
Next Para
End Sub
I have run it on a couple of simple word files. Hope it helps. ▲ Collapse | |
|
|
Alex Lago Испания Local time: 07:50 английский => испанский + ... Автор темы Thanks Mikhail | Nov 13, 2014 |
Worked perfectly, thank you. | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Copy all paragraphs underneath each other in MS Word Wordfast Pro | Translation Memory Software for Any Platform
Exclusive discount for ProZ.com users!
Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value
Buy now! » |
| Trados Studio 2022 Freelance | The leading translation software used by over 270,000 translators.
Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop
and cloud solution, empowering you to work in the most efficient and cost-effective way.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |