tt4t.net
tips & tricks
for translators
Useful Word Macros  

Contents

Note: These macros are useful not only when using Déjà Vu, but in many other circumstances.

 

General Info

About Word Macros

Macros in text format

Hide and Show Text Boxes

Paint and Hide DV codes in a 2-column file

Move index marks to the end of the paragraph

Save As "Original_ + filename"

Hide and Unhide text

Number Notation

How to change Trados codes

Cleaning Rogue Codes

Moving text from text boxes to "dummy tables" and back

Painting Trados Segments

Running macros in all files inside a folder

Deleting all bookmarks in a document

Deleting all comments in a document

Finding and replacing text highlighted in a specific color

Adding a file name in a footer

Scripts (Visual Basic - vbs)

Converting TTX Files in BIF Files

Macros in templates (.dot files)

Removing and Re-inserting Graphics

Complete Word Count

 

GENERAL INFO

About Word Macros

Macros are little programs that allows you to run repetitive tasks inside Word. There are some extremely handy macros, and once you understand their power, it is difficult to live without them. To learn more about macros and how to handle them, visit Microsoft Word MVP Website.

In Word, macros are stored inside Template files (extension Dot). As the main Word template (normal.dot) is too prone to be corrupted, it is recommended that you keep your macros in a different template.

You can receive a macro in many formats: text, basic or directly in a Dot file.

For you to run a macro, the template that contains it should be active. Templates stored in the Startup directory are automatically activated when you open Word. If you do not know where is your Startup directory, please go to Tools > Options > File Locations and the Startup directory is listed there.

If you receive a "Dot" file, place it in your Startup directory.

If you receive a text file or a visual basic file, visit the suggested site above.

If you want to learn Visual Basic, visit MS Visual Basic Guide.


Top - Home/Disclaimer

MACROS IN TEXT FORMAT

Hide and Show Text Boxes (txt)

Örjan Skoglösa

With a macro it is possible to cycle through all text boxes and make the content hidden and then revert the change afterwards.

To hid text, use macro named Maketxtboxhidden. To show text, use macro named Maketxtboxunhidden. Both macros can be found inside Hide_Show_Text_Boxes.txt.


Top - Home/Disclaimer

Paint and Hide DV codes in a 2-column file (txt)

Lorenzo Martinelli

Hide_DV_Codes.txt — This macro paints and hides DV codes in a 2-column exported file.


Top - Home/Disclaimer

To move index marks to the end of the paragraph (txt)

Old posting/suggestion by Emilio Benito

I don't like the idea of moving all fields. The macro (for Word 8), tested only with the simplest documents, will move just index entries.

Move_Index_Entries.txt

This macro will move index entries to the end of the paragraph, so that you can translate everything without splitting sentences.


Top - Home/Disclaimer

Save As "Original_ + filename" (txt)

Miri Ofek

Save_Doc_With_Other_Name.txt

This macro saves the active document with another name (Original_ + document name). Some people like to save the original document before fiddling with its format:


Top - Home/Disclaimer

 

Hide and Unhide text (txt)

Rob Laumen

To hide text between (), [], {}, or <> and revert (unhide) afterwards. Both macros are inside Hide_Show_Delimited_Text.txt.

"brackets" means "start character" and "stop character", and can be: () [] {} <>



Top - Home/Disclaimer

Number Notation (txt)

Edson Furmankiewicz

Number_Separators.txt

This macro changes the notation of a number from European to North-American or vice-versa.

E.g.:
Replaces 1,098,879.98 with 1.098.879,98 or
1.098.879,98 with 1,098,879.98.

Attention: Use it carefully. It replaces any comma inside a number with a dot and vice-versa, in ALL instances. In many cases, this is NOT what you want (E.g.: you generally do not want to replace it in a version number > Version 2.1).


Top - Home/Disclaimer


How to change Trados Codes in DOC/RTF files (txt)

To change WB Trados codes, so all segments are imported into Déjà Vu.

Install and use macro Changing_Trados_Codes.

This macro was developed based on Judy Ann Schoen's Trados100 macro. Her macro can be found at Yahoo's (change_Trados_to100.zip). 


Top - Home/Disclaimer

Cleaning Rogue Codes (txt)

For more info, see Rogue Codes.

Clean_Rogue_Codes.txt


Top - Home/Disclaimer

 

Moving text from text boxes to "dummy tables" and back

Örjan Skoglösa

textboxes_out_in.txt

The content is moved out from the textboxes into dummy tables, then after translation back again.


Top - Home/Disclaimer

 

Painting Trados Segments

DVX does not paint Trados segments when exporting a translation. This macro paint segments in the following manner: source > dark blue; fuzzy matches (0-99%) > magenta; matches (100%) > green.

PaintSegmentsInTrados.txt


Top - Home/Disclaimer

Running macros in all files inside a folder

Steven Marzuola

Macro to run macros in all files inside a folder: Process_files.txt


Top - Home/Disclaimer

Deleting all bookmarks in a document

Gary Daine

This macro erases all bookmarks in a document

EraseBookmarks.txt


Top - Home/Disclaimer

Deleting all comments in a document

This macro erases all comments in a document

EraseComments.txt


Top - Home/Disclaimer

Finding and replacing text highlighted in a specific color

Dawn Crosier & Dian Chapman (MVPs)

LookForHighlight.txt

This macro looks for Light Green Highlights and replaces the corresponding text with a white font. Macro was posted in microsoft.public.word.newusers @ news.microsoft.com answering a question I had posted.


Top - Home/Disclaimer

Adding a file name in a footer

This macro adds the file name in a footer, in all files of the same directory.

Add_Name_To_Footer.txt


Top - Home/Disclaimer

 

SCRIPTS (Visual Basic / vbs)

Converting TTX files in BIF files

There is a script that converts all TTX files inside a folder in BIF files. The script can be found in the Files section of the TW_users group. It is named SaveAsBIF.vbs.


Top - Home/Disclaimer

MACROS IN TEMPLATES (.dot)

Removing and reinserting graphics in a file (Dot)

 

Miri Ofek

 

Miri Ofek, a Déjà Vu user, developed some Word macros to help removing and reinserting graphics in a Word file. Once the graphics are removed, it is very easy to import, translate, and export the translated file. The macros are in a Word template file (ImagesOutIn.dot) — to download it, click here

How to use Miri's macros:

  • Open template (Tools > Templates and Add-ins > Add).

  • Open your file and run the first two macros: "Convert Floating to Inline2" and "Inline Shapes Out2."

  • Close both files (there will be one text file and one graphic file). Translate text file normally.

  • Copy graphic file to the folder where your translation is. 

  • Open translated file and open graphic file. Active file should be the translated file.

  • Run third macro (Inline Shapes2) from translated file.


Top - Home/Disclaimer

Complete Word Count

Shaune Kelly developed a Macro to make a complete word count in Word (including text boxes, header, footer, etc.):

Shaune Kelly's Website


Top - Home/Disclaimer