Welcome / Bienvenue / Benvinguts / Bienvenidos
For information about my translation services, please visit the main site.
Pour des informations sur mes services, merci de regarder le site principal.
Para información sobre mis servicios de traducción, visite el web principal.

Prevent PerfectIt from introducing mistakes into your text

A common complaint on PerfectIt user forums is that PerfectIt introduces mistakes when you use the fix button. This is particularly dangerous if you use the Fix all button. Imagine trying to remove a hyphen from 30 occurrences of the same word, only to discover much later (when it’s too late to use undo) that it has introduced 30 mistakes in your document!

In this video, I explain why it happens and how you can prevent it from happening.

I also mention a PerfectIt masterclass series that I’ll be running soon. The series will be announced on this blog. In the meantime, follow the #PerfectItMasterclass hashtag on Twitter, where I’ll be sharing some PerfectIt tips and explaining giving you a preview of some of the things I’ll be talking about during the masterclass.

Share:

How to change the language in all stories (including comments) in a Word document

Updated version uploaded on 1 December 2022. This updated version includes a correction of the error that was in the video and other minor tweaks, and it now updates the language in certain cases where it previously did not work.

Ever felt frustrated when Word keeps selecting the wrong language every time you add a comment? This video explains how to change the language for all elements of a Word document, including footnotes, comments and text boxed, in an instant.

The macro code is below. The video explains how to import the code. Note that near the top of the code, sandwiched between asterisks, there is a line you may need to change, depending on the language and variety that you want to use.

Please leave a comment to let me know whether it works for you.


Sub LanguageAllStyles()

Dim LanguageId As MsoLanguageID

'***************
LanguageId = msoLanguageIDEnglishUK ' Insert the Name or the Value listed at https://learn.microsoft.com/en-us/office/vba/api/word.wdlanguageid.

'***************

' Macro to change language in styles
' Loosely based on a macro posted by Macropod (17 July 2012)
' http://www.vbaexpress.com/forum/showthread.php?42993-Solved-Macro-to-change-all-styles-to-a-specific-languageDim TrackChangesActive As Boolean ' Only possible values are True/False

Dim CheckSpellingAsYouTypeActive As Boolean
Dim CheckGrammarAsYouTypeActive As Boolean
Dim ShowFormatChanges As Boolean
Dim doc As Document
Dim SkipTrackChangesQuestion As Boolean

Dim oDoc As Document, oSty As Style, oStor As Range

Application.ScreenUpdating = False

'Block taken from my personal “MacroSwitchesOff” code
If Options.CheckSpellingAsYouType = True Then CheckSpellingAsYouTypeActive = True Else CheckSpellingAsYouTypeActive = False ' Checks whether CheckSpellingAsYouType is switched on.
Options.CheckSpellingAsYouType = False
' Forces Word to check everything again with the new language. Cancel the above line if you don’t want Word to forget when you’ve “Ignored” a flagged spelling.
' Without switching this setting off and on, Word still underlines words that are correctly written in the new language.
If Options.CheckGrammarAsYouType = True Then CheckGrammarAsYouTypeActive = True Else CheckGrammarAsYouTypeActive = False
Options.CheckGrammarAsYouType = False
' See previous comment

If ActiveDocument.ActiveWindow.View.ShowFormatChanges = True Then ShowFormatChanges = True Else ShowFormatChanges = False
ActiveDocument.ActiveWindow.View.ShowFormatChanges = False
'Check whether Format changes are shown

If ActiveDocument.TrackRevisions = True Then TrackChangesActive = True Else TrackChangesActive = False

If SkipTrackChangesQuestion <> True Then ' Skip the track changes question
If MsgBox("Perform the operation with track changes?", _
vbYesNoCancel) = vbNo Then
ActiveDocument.TrackRevisions = False
Else
ActiveDocument.TrackRevisions = True
End If
End If

Set oDoc = ActiveDocument
With oDoc
For Each oSty In .Styles
StatusBar = oSty
On Error Resume Next
oSty.LanguageId = LanguageId
On Error GoTo 0
Next
End With

With oDoc
For Each oStor In .StoryRanges
StatusBar = "Setting story " & oStor & " to language " & LanguageId
oStor.LanguageId = LanguageId
Next oStor
End With

ActiveDocument.Range.LanguageId = LanguageId ' Uses the normal method, equivalent of pressing ctrl+a and setting the language.

'Block taken from my personal “MacroSwitchesOnAgain” code
' The lines below revert settings to the status they had before the macro was run
If TrackChangesActive = True Then ActiveDocument.TrackRevisions = True
If CheckSpellingAsYouTypeActive = True Then Options.CheckSpellingAsYouType = True
If CheckGrammarAsYouTypeActive = True Then Options.CheckGrammarAsYouType = True
If ShowFormatChanges = True Then ActiveDocument.ActiveWindow.View.ShowFormatChanges = True
ActiveDocument.ActiveWindow.View.ShowFormatChanges = True

Application.ScreenUpdating = True

MsgBox ("Finished! The language of all sections of the document has been set to " & LanguageId & ". If you wanted to select another language, open the VBA editor by pressing alt+f11 and change the 'LanguageID' shown at the top of the script")
End Sub

Share:

Macro to prepare documents for monolingual review in memoQ (and possibly other CAT tools)

MemoQ’s monolingual review feature works best with clean Word documents containing no tracked changes or comments. If you import a document in which changes are still visible or in which there are comments, memoQ will add lots of code to the target text, which you don’t want.

This macro cleans the document up and saves it under a new filename (so that you don’t overwrite the commented version), making it ready to be imported as a monolingual review.

The macro includes comments to explain what some of the lines are doing and how you can adjust the macro to meet your needs.

Since many translators use only straight apostrophes and quotation marks in memoQ, then convert them to the curly variety in the final document sent to the client, the macro includes an optional line (deactivated by default) that will revert all apostrophes and quotation marks to the straight variety. Please read the instructions carefully if you wish to use that line.

Thanks to Kevin Mote, who provided the code for the part of the macro that renames the file. My code is a slightly modified version of his. In particular, unlike Kevin’s version, mine does not overwrite the old version, since most translators would want to keep a copy of the commented version they sent to their client.


Sub PrepareForMemoQMonolingualReview()
' memoQ's monolingual review feature works best when you import a document with no tracked changes and no comments.
' This macro removes them, then resaves the file with "clean-for-import" appended to the file name.
' The part that appends the filename is adapted from the macro provided by Kevin Mote (https://www.linkedin.com/in/kevinmote/) at https://superuser.com/a/781501. Thank you Kevin. This was very helpful!
' Please note that, unlike Kevin's macro, this version does not delete the original file.
Dim strFileFullName, strFileName, strNewName, strFileExtension As String
'
ActiveDocument.AcceptAllRevisions ' Accepts all tracked changes
ActiveDocument.TrackRevisions = False ' Switches off track changes
ActiveDocument.DeleteAllComments ' Deletes all comments in the active document.

ReplaceQuotes ' Reverts quotation marks and apostrophes back to the straight variety, assuming that this is the variety that was used while working in the CAT tool.
' Remove the apostrophe from the above line if you want the monolingual review document to revert to straight apostrophes and quotation marks.
' Note that to run the above line you also need to have installed the "ReplaceQuotes" and "QuotesReplacementBothWays" macros, which I provided along with several others in a blog post at http://www.anglopremier.com/blog/?p=1119.
' *****ADDITIONAL OPTION DESCRIBED ABOVE*****

' Get current name:
strFileFullName = ActiveDocument.FullName 'for Word docs
'strFileFullName = ActiveWorkbook.FullName 'Use this line instead for for Excel docs
'strFileFullName = Application.ActivePresentation.FullName 'Use this line instead for Powerpoint presentations
If (InStr(strFileFullName, ".") = 0) Then ' Checks whether the full file name contains a file extension by looking for a dot.
res = MsgBox("File has not been saved. Can't rename it.", , "Rename File")
Exit Sub
End If
' strFileName = Right(strFileFullName, Len(strFileFullName) - InStrRev(strFileFullName, "\")) 'strip path - not used. Next line used instead.
strFileName = strFileFullName
strFileExtension = Right(strFileName, Len(strFileName) - InStrRev(strFileName, ".")) ' Identifies the file extension
strFileName = Left(strFileName, (InStr(strFileName, ".") - 1)) ' Strips the extension from the strFileName variable
' If InStr(3, strFileName, "_Delivery", 1) <> 0 Then strFileName = Left(strFileName, (InStr(strFileName, "_Delivery", 1) - 1))
' The above line is not used. Originally intended to strip the word "_Delivery" and the delivery number from the file name (assumes "Delivery" is at least the third character; not case-sensitive). But I dedcided I wanted to keep the delivery number.
' If you wish to remove something from the file name you can reinstate the above line (remove the apostrophe) and replace "_Delivery" with whatever you want to remove.

' Prompt for new name. Replace "_clean-for-import" on the next line if you prefer something else to be appended by default.
strNewName = InputBox("Rename this file to:", "Rename File", strFileName & "_clean-for-import." & strFileExtension) 'Saves with the new name. Extension is not changed.
If (strNewName = "") Or (strNewName = strFileName) Then ' (Check whether user cancelled)
Exit Sub
End If

' Save file with new name:
ActiveDocument.SaveAs2 FileName:=strNewName 'for Word docs
'ActiveWorkbook.SaveAs2 FileName:=strNewName 'for Excel docs
'Application.ActivePresentation.SaveAs FileName:=strNewName 'for Powerpoint presentations

End Sub

Share:

AutoHotkey script to move the focus away from the Concordance window

Sometimes you want to keep the MemoQ Concordance window open on your second screen while you work on your document. But there’s no built-in method to achieve this with the keyboard. You can only do so by clicking with the mouse.

This short script moves the focus away from the Concordance window and to the main MemoQ window, allowing you to work on the document while keeping the Concordance window open. Just press ctrl+k to activate the script.


#IfWinActive, Concordance
^k:: ; MemoQ: Move focus away from Concordance window
WinActivate memoQ
#IfWinActive
return

The following script closes the Concordance window. Continue reading

Share:

Useful links related to PerfectIt

PerfectIt checks: A brief explanation of each check performed by PerfectIt, with links to a full explanation.

PerfectIt style sheets: Information on working with style sheets and customising them.

PerfectIt settings tab: What the options in the Settings tab do and how to configure them.

Introduction to MS Word wildcards: An exercise providing a basic introduction to using wildcards in Microsoft Word. Includes links to other, more comprehensive resources on Word wildcards.

Users’ Facebook group: A Facebook group for PerfectIt users. Users ask how to configure certain settings. Particularly useful if you can’t get a wildcard search working.

Associations offering discounts: a list of associations whose members are entitled to a discount on PerfectIt.

Interested in a workshop?

I organise PerfectIt workshops for translators’ and editors’ associations in which I provide an overview of the program, then delve into its advanced features. I usually end with an interactive section in which participants can ask me how to enforce certain style rules using PerfectIt. For more information, write to the e-mail address found on my main website.

If you have already attended one of my workshops and have not received How-to…with-PerfectIt4.pdf, send me an e-mail and I’ll send you a copy.

IntelligentEditing’s playlist on building stylesheets

Share:

La facturation en monnaie étrangère : un formulaire pour convertir les prix en euros selon la loi française

La loi française permet la facturation en monnaie étrangère, et le portail de l’Économie, des Finances, de l’Action et des Comptes publics explique comment le faire.

Pour le calcul du montant en euros de vos factures, j’ai créé un formulaire Excel. Il suffit d’introduire la date de facture, le montant et la devise pour que le formulaire vous calcule le montant en euros selon les deux méthodes permis par la loi française. Les taux de changes utilisés pour les conversions sont les taux officiaux de la Banque centrale européenne, qui publie les taux de référence utilisés par les autorités françaises.

ConversionFacturesDevises par anglopremier.com.

Share:

How to remove an initial cap from glossary entries

Many online glossaries start every term with a capital letter, such as in this example:

  • Comptes d’accumulation
  • Accumulation accounts

Since these terms would only be capped at the start of a sentence, translators ought to import them without the initial caps.

Use the following formula in Excel to remove leading caps. The formula below assumes the first term is in cell E1, but to change it to wherever your first term is, then paste it down all the rows containing terms.

=IF(EXACT(UPPER(MID(E1,2,1)),MID(E1,2,1))=TRUE,E1,LOWER(LEFT(E1,1))&RIGHT(E1,LEN(E1)-1))

Please note that if you don’t use Excel in English, you will need to translate the formula words. Also, if you have your system set to use decimal commas, replace the commas in the formula with semi-colons.

The reason the formula is so long is because it initially checks to see whether the second character is capped. If the second character is also capped, it assumes the term is an acronym, and therefore does not change the first character to lower case.

Share:

Macro to replace smart quotes and smart apostrophes with straight quotes and straight apostrophes in Word

UPDATE: I no longer recommend this macro because it does not look at footnotes and text boxes. Instead, you should use the macro available here.

Many users of CAT tools like to convert smart quotes and apostrophes to straight ones before translating their documents, because if the straight versions are always used, it means concordance searches for words including apostrophes will always work.

The problem is that it takes quite a while to do this in MS Word. You can’t just find/replace the apostrophes, because even if you put a straight apostrophe in the replace box, Word will interpret it as a smart apostrophe if you have set Word up to use straight apostrophes and quotes.

Of course, you could change that setting, but then it is more complicated to convert the straight varieties to the smart varieties after exporting from your CAT tool.

The solution is to use a macro that will automatically switch smart quotes and apostrophes off, then perform the search, then switch them back on.

Here’s a macro that will do just that.

Option Explicit
Sub ReplaceQuotes()
' ReplaceQuotes Macro, by Timothy Barton, Anglo Premier Translations
'
Application.Options.AutoFormatAsYouTypeReplaceQuotes = False
Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting

With Selection.find
.Text = ChrW(8220)
.Replacement.Text = """"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = ChrW(8221)
.Replacement.Text = """"

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = "´"
.Replacement.Text = "'"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = "‘"
.Replacement.Text = "'"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = "’"
.Replacement.Text = "'"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.find.Execute Replace:=wdReplaceAll
Application.Options.AutoFormatAsYouTypeReplaceQuotes = True

Dim oShell As Object
Dim iResponse As Integer
Set oShell = CreateObject("Wscript.Shell")

iResponse = MsgBox("Procedure complete. Code provided by Timothy Barton, Anglo Premier Translations. Would you like to visit the website?", _
vbYesNo, "Procedure complete")

If iResponse = vbYes Then
oShell.Run ("http://www.anglopremier.com?utm_campaign=apostrophesmacro&utm_medium=referral&utm_source=blog")
Else
Exit Sub
End If

End Sub

Share:

Use old-style Excel and Word menus in new versions of Office

A common complaint people make when they install Word 2007 (or Excel 2007) or later is that they don’t like the ribbon and prefer the menus used in Word 2003 (or Excel 2003) and earlier. Microsoft insist that things are easier to find in the new version, but many of us beg to differ. For me, my main qualm with the new version is that it takes me longer to browse through all the options than it did with the old system.

Also, certain options are in illogical places. For example, if you want to insert a row or column in Excel you’ll probably look in the “Insert” tab. But you won’t find it. It’s in the “Home” tab. Why on earth is an “insert” option not in the “Insert” tab?

The Swiss company UBit has produced an add-on that creates a ribbon tab called “Menu”, which contains old-style menus. The add-on can be downloaded from here.

Unfortunately it doesn’t allow you to open the menus with the keyboard. And that’s where I come in! I’ve produced a script to be used with UBitMenu that allows you to open up the menus using the keyboard (i.e. alt+f opens the file menu, etc.) and browse through with the cursor keys. Click here to download the script.

Once you have installed UBitMenu and my script, you can browse through the menus almost as easily as in the old version of Word and Excel.

Please note it currently only works with the English menu shortcuts, and it may not work with certain screen resolutions, as it relies on clicks on the correct part of the screen.

If you test it, please report back whether it works for you.

If you would like a version for your own language, please tell me the shortcut letters for the different menus (File, Edit, View, Format, Tools, Table and Window) in your language.

Share:

Bookmarklet tweaks

I’ve corrected some of the bookmarklets I made available on my main website. All the bookmarklets now lead to the correct site, and the Oxford English Dictionary one now works with all words. There is also a link to a site explaining how to disable speed dial in Firefox, since the bookmarklets don’t work if you are on the speed dial page.

Share: