How to Solve an Error when Trying to Save Target Document in SDL Studio

One of the most annoying and stressful problems to encounter after processing a document in a Translation Environment Tool is finding out that the target file cannot be created due to some obscure and vague error. This type of scenarios is relatively common – it has actually just happened to me – so I thought that this would be a good opportunity to write a short article about this issue.

This error usually stems from missing tags, tags that were mishandled by the TEnT, or problems in the underlying structure of the source file.

The good news is that there are best practices to follow for diagnosing these issues in a timely manner before the work starts, preventing them during the work, and solving them even after the work has been completed. There are no guarantees because there are almost an infinite number of project-specific parameters, including the file type and the specific TEnT with its unique quirks, that vary between projects, but in most use-case scenarios following these best practices will save a lot of time, frustration and stress at the end of the project.

I’m using SDL Studio 2014 as my main TEnT and therefore will focus mostly on working with it, but these best practices should apply to all other TEnTs, with the necessary adjustments to account for each tool workflow and intrinsic “quirks”.

Best Practices for Making Sure That the Target Document Can be Created at the end of a project

Diagnosis

SDL Studio Save Target As Command
The first best practice is to try and save the target document right after it was opened in the TEnT. In SDL Studio this is invoked from the Editor view by pressing the Shift+F12 keyboard shortcut for via the File > Save Target As menu command. In case of any structural issues in the source file that prevent saving the target document in its original format, they will be discovered at this point, which is the best timing during the project to learn about them because there is enough headroom to perform all the necessary corrective actions and adjust the project timetable and/or fee as necessary.

If the target file was created successfully it means that the structure of the original file is intact, and any further error is most likely associated with missing inline tags, an issue that can be easily corrected.

Prevention

To avoid accidental deletion or omission of inline tags it is recommended not to work with a visual editor (the one displaying the text in its final formatting without the tags that control that formatting) and set-up the TEnT to display all tags instead.
In SDL Studio:

  • Click File > Options;
  • Select the Editor sub-menu from the left pane;
  • From the Formatting display style dropdown list, select Show all formatting and tags;
  • Click OK to confirm and exit.
  • It is important to note that the amount of tag information that is displayed for each tag In the Editor windows can be controlled, as explained by Paul Filkin in his article Simple guide to working with Tags in Studio which I recommend reading to better understand how to work in tags. Displaying the full tag text can come in handy when needing to understand what formatting a tag represents, while still keeping all tags visible.

Corrective Actions to solve an Error when Trying to Create the Target Document

If you followed the first best practice (trying to create the target document after opening the file in the TEnT) and an error occurs, it means that there is an issue with the structure of the source file that must be resolved before the translation work starts. It is important to pay attention to the error details because sometimes they can point to the source of the problem and allow a more targeted approach for fixing it.

The following corrective actions are displayed in the order that I think is the recommended procedure to go about solving a general and unspecific target document creation error, but they can be used in any order.
Note: Before stating to do anything, create a backup copy of the original file. If the error occurred at the end of translation, make sure to save the Bilingual file and update or create a TM to use later with the new source file.

Open and Repair the Document

From my experience most of the more persistent errors of this type seem to be associated with Word documents. Because these issues usually stem from a structural error in the source file, trying to repair the file using Word’s Open and Repair command is a good starting point:

  • Open Microsoft Word;
  • Click File > Open and navigate to the source file;
  • Instead of clicking Open, click the down-arrow in the Open button and select the Open and Repair command.

MS Word 2010 Open and Repair Command

Saving the Source File in Another File Format

All word processors file formats support basic and common text formatting such as Bold, Italics, Underline, Color, etc., but use a different underlying structure for storing the data. Saving the original file in another file format – specifically one that supports less “complex” features – can remove some common underlying structures that are known to get broken or mishandled, while still maintaining all or most of the visual formatting. The recommended file format to use is the RTF (Rich Text Format) file format. Generally it is considered safe converting the original file into RTF without worrying too much about losing key formatting or functionality.

If the RTF conversion doesn’t work, I also suggest to try saving as DOC and DOCX file formats (in Microsoft Word and depending on the original file format), or as ODT if using another word processor that support this file format.

Now, try to import or open the converted file in the TEnT and create the target document.

Removing all Bookmarks from the Document

Word documents can contain bookmarks such as Table of Contents and Cross-references that are sometimes get broken, or mishandled by the TEnT. SDL Studio is quite known for mishandling some bookmarks at times (at seems a bit at random), so this clause is specifically relevant to Studio users.

The solution in this case is to remove all bookmarks from the original document and then process it again in the TEnT. If these bookmarks are important for the functionality of the file they need to be added after the target has been created.

There are two ways to remove the bookmarks from the document:
1. Manually
If there aren’t many bookmarks in the document and/or if after consulting the error message details you know which bookmark is likely to be responsible for the error, it might be more effective to remove the bookmarks one-by-one until the culprit is identified.

To display the bookmarks list:

  • Select the Insert Ribbon tab in Microsoft Word;
  • From the Links Ribbon group select the Bookmark command;
  • Select the Hidden bookmarks checkbox at the bottom of the windows to display all bookmarks in the document;
  • Select the required bookmark and click the Delete button to remove it.

MS Word 2010 Bookmark selection window
2. Using a Macro to Automatically Remove all Bookmarks from a Document
If the document has a lot of bookmarks it is not very practical to remove them manually. Fortunately, a Macro is available to remove all the bookmarks (including the hidden ones) at one fell swoop. The following Macro code is taken from Microsoft’s Support website.
The Code:

Sub StripAllBookmarks()
Dim stBookmark As Bookmark
ActiveDocument.Bookmarks.ShowHidden = True
If ActiveDocument.Bookmarks.Count >= 1 Then
For Each stBookmark In ActiveDocument.Bookmarks
stBookmark.Delete
Next stBookmark
End If
End Sub

Removing AutoText fields (corresponds to the Enumeration already finished error

When working with DOCX siles, the Enumeration already finished error is a Special Case of the general Failed to Save Target As error. This error is most likely the result of AuoText Entries. The following instructions on how to delete the AutoText Fields are based on the Delete an AutoText entry article (that refers to Word 2003) by Microsoft, but refers to Office 2010 and 2013:

  1. On the Insert tab, select the Quick Parts menu under the Text group, and then the Building Blocks Organizer… command.
  2. Sort the entries by the Gallery column.
  3. Click the name of the AutoText entry that you want to delete and then the Delete button.

Note: Deletion of an AutoText entry cannot be undone. The only way to restore an AutoText entry is to create it again manually. Therefore, use with caution.

Due to the possible issues that deleting AutoText entries could have on other or future documents, a more safe approach in my opinion is to save the original document in a DOC format, translate it, and in the end save it back as DOCX; if the error occurred after the translation is already complete, save the file in a DOC format and re-translate it using the existing Translation Memory./p>

Running the tool’s built-in Tag Verification

If you forgot to test save the target document before starting the work only to find out that an error occurs at end, or if the target document was created successfully at the beginning of the work but now an error occurs, the first action to take is running the TEnT’s built-in Tag Verification function and correcting any tag-related issues that it identifies.

In SDL Studio the Tag Verification is invoked by pressing the F8 Keyboard shortcut, or from the Review Tab > Quality Assurance group > Verify command.

Note: Some formatting tags like font color, Italics, Bold, superscript etc. are sometimes omitted by the translator on purpose. However, if a target saving error occurs, make sure to add all the missing tags that were identified by the Tag Verification function; even those that were removed intentionally (just add them to the appropriate segment but don’t enclose any text within them).

Conclusion

Not being able to create the translated document after processing it using a TEnT is quite stressful because there is no clear corrective action to take and the deadline and/or start of the next project are nearing.

In this article I have attempted to offer several best practices for diagnosing this error at the beginning of the project to allow for any resulting adjustments to the timetable and/or fee for correcting the issue, preventing accidental deletion of tags during the transition process, and some recommended corrective actions.

9 responses to “How to Solve an Error when Trying to Save Target Document in SDL Studio”

  1. Laurence Nerry Avatar
    Laurence Nerry

    Dear Shai Nave,
    Thank you so much for this very clear and thorough article. I have been struggling with this problem for a while now, and this is the most complete and efficient reply I have come across so far. I will make sure to follow all of these steps in the recommended order in the future.
    Merci !
    Kind regards,
    Laurence

    1. Shai Avatar
      Shai

      Hello Laurence,

      Thank you very much for taking the time to read this and for your kind words.

  2. David Hardisty Avatar
    David Hardisty

    Great article. Thank you.

    If after taking all the cares in the world, you find that you cannot Save as Target in SDL Trados and get your final translation, you can always use the Export for External Review option, mainly designed to change a bilingual file into a Word format for technical/specialised editing for somebody without a CAT Tool.

    – Export for External Review,
    – Open the resulting bilingual file in Word.
    – Copy the column with the target text into a new document.
    – Convert the table for text
    – Take out all the tags using Substitute “Nothing (Style – Tag)
    The good news is you have your translation. The bad news is you have lost your formatting.
    But if it is this or not having your translation, better than nothing.
    Now if there was a way of keeping even minimal formatting, I would be very interested to learn this!

    PS You can do the same with the Export option in MemoQ and in Wordfast Anywhere.

    1. Shai Avatar
      Shai

      Thank you for your comment, David.

      Extracting the translated content is indeed a viable and valuable option to have if all else fails.

  3. Jaap Avatar
    Jaap

    I just came across this error message after translating a document of 18.000 words… I used a few of the tips above to quickly recover:

    -Base a TM on the file that refuses to be saved as Target
    -Open and recover the original untranslated document in Word
    -Save it (I changed it from a .doc to a .docx)
    -Open the newly saved file to translate and use the TM you just generated
    -Pretranslate the document
    -Depending on how much segments you merged etc. you will have your translation almost done
    -Save Target as
    -Ready!

    I hope this will help some people who encounter this terrible error message!

    1. Shai Avatar
      Shai

      Thank you for your comment, Jaap.

      Studio 2015 introduced a new file type called “Microsoft Word 2007-2015”. This file type introduces several improvements in handling DOCX files, and this should lead to fewer errors when trying to create the translated document.

      At the time of this writing it is disabled by default, so on needs to manually enable it:
      Options > File Types > Select the Microsoft Word 2007-2016 file type > And move it above the Microsoft Word 2007-2013 (I would also recommend disabling the 2007-2013 file type) so it will get precedence over similar file types.

      Enabling the new Word 2007-2016 file type in SDL Studio 2015

      The change will affect only new projects, and not the existing project.
      This file type can be also activated through the Project Settings menu, but will apply only to new files added to the project.
      If you you get an error when using the older file type, it is worth trying to activate the Microsoft Word 2007-2016 file type, re-import the source DOCX file (now parsed using the new file type filter), pre-translate using the TM, and attempting to save the target document again.

  4. Dang Nam Avatar

    Thanks, I also encountered this situation a couple of times. It made me lose a lot of time

  5. Kaspars Kalniņš Avatar
    Kaspars Kalniņš

    Thanks a lot!

    Your tips saved huge time for my 160 000 words project (PDF to Word converted files 4 pcs, aprox. 40 k words each). I get message “Failed to save….”. After verificatio in Trados 2017 (F8) I get about 400 erors.

    I copied source file, run Word’s “Open and Repair”. My file contains 1100 hidden bookmarks. So, I use described Macro (now this is my nyew skill) and delete them all.

    Repaired file I added as source in Trados project using TM. After some small additions I get targert Word file.

    Thanks a lot! Your are God!

    1. Shai Avatar
      Shai

      Hello Kaspars,
      Thank you for your kind words and for taking the time to comment.
      I’ve glad this helped. Failing to save target is always a stressful situation to find yourself in, and even more so with a sizeable project. Luckily, at least as far as Word files go, the solution is often quite straightforward — albeit requires some manual work and a bit of trial and error.

      Make sure to enable the new Word file filter in Studio 2017 (and newer versions). The one called (at the time of this writing) Microsoft Word 2007-2016. You should place it above all of the other Word-related file filters in the File Types list for a given project and in the global settings (File > Options > File Types).
      The new file filter does away with most of the Word-related quirks of the older file filters, which means you’ll be far less likely to run into such issues in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *