Macro for correcting specific frequent spelling mistakes Thread poster: ahmadwadan.com
|
Hi, I need a Macro for correcting specific frequent spelling mistakes which I already know and have a list of. Lets say that you frequently receive files of almost the same spelling mistakes such as: adn>>and financail>>financial to gether>>together …etc What I need is a macro to automatically fix such mistakes in source before starting translation so matching percentage of Trados gets high. Note: the macro is suppose... See more Hi, I need a Macro for correcting specific frequent spelling mistakes which I already know and have a list of. Lets say that you frequently receive files of almost the same spelling mistakes such as: adn>>and financail>>financial to gether>>together …etc What I need is a macro to automatically fix such mistakes in source before starting translation so matching percentage of Trados gets high. Note: the macro is supposed to have a control to convert “whole words” so it will not make a mess of correct words. For example: it is not supposed to convert “adn” to "and" when it occurs in “adnan” Thank you so much I appreciate your help Ahmad Wadan Financial Translator ▲ Collapse | | |
Easy task for the macro recorder in Word | Jun 26, 2008 |
... which produced this: Sub SpellReplace() ' ' SpellReplace Makro ' Makro zapisane 6/26/2008 przez Wolfgang Jörissen ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "adn" .Replacement.Text = "and" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .Match... See more ... which produced this: Sub SpellReplace() ' ' SpellReplace Makro ' Makro zapisane 6/26/2008 przez Wolfgang Jörissen ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "adn" .Replacement.Text = "and" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = True .MatchKashida = False .MatchDiacritics = False .MatchAlefHamza = False .MatchControl = False .MatchByte = False .CorrectHangulEndings = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False .MatchFuzzy = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "financail" .Replacement.Text = "financial" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = True .MatchKashida = False .MatchDiacritics = False .MatchAlefHamza = False .MatchControl = False .MatchByte = False .CorrectHangulEndings = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False .MatchFuzzy = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "to gether" .Replacement.Text = "together" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchKashida = False .MatchDiacritics = False .MatchAlefHamza = False .MatchControl = False .MatchByte = False .CorrectHangulEndings = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False .MatchFuzzy = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub ▲ Collapse | | |
Tony M France Local time: 17:16 Member French to English + ... SITE LOCALIZER I have a beta version of a little program that does this | Jun 26, 2008 |
The only snag is, since it is still only in development, the list of words and corrections has to be entered manually, which is fiddly and tedious if the list is very long. If no other solution comes to light, this might be of some interest. (NB: it doesn't cope very well with the 'whole words only' issue, but there is a sort of fudge that helps a bit.) | | |
The "whole words" issue should not be a big deal, since Word has the "Search for whole words only" option in the Search/replace window. In the macro, this is reflected as .MatchWholeWord = True | |
|
|
ahmadwadan.com Saudi Arabia Local time: 18:16 English to Arabic + ... TOPIC STARTER
Wolfgang Jörissen wrote: ... which produced this: End Sub Dear Wolfgang, This is exactly what I need. It works for English text. Now I am working to apply this to Arabic text but Arabic characters appear scrambled (encoding issue) in Visual Basic Editor so it did not work for Arabic. I wish you have a solution for this. Thank you so much | | |
Try recording it yourself | Jun 26, 2008 |
That's all I did. Not sure about the exact commands in the English Word version, but AFAIK, it's Tools - Macro - Record. | | |
ahmadwadan.com Saudi Arabia Local time: 18:16 English to Arabic + ... TOPIC STARTER Codes for Arabic characters | Jun 26, 2008 |
Wolfgang Jörissen wrote: That's all I did. Not sure about the exact commands in the English Word version, but AFAIK, it's Tools - Macro - Record. Yes, I tried this, but the problem with Arabic is that Macro replace Arabic characters with numbers so I can not know which is which. For example: you may find an Arabic word represented by a code "251897". Thank you Wolfgang | | |
|
|
ahmadwadan.com Saudi Arabia Local time: 18:16 English to Arabic + ... TOPIC STARTER Just change font to view Arabic | Jun 26, 2008 |
From Macro editor click Tools>>Options>>Edit Format>> then select an Arabic font on the right. Kind regards | | |
Yaotl Altan Mexico Local time: 09:16 Member (2006) English to Spanish + ...
Is it necessary a macro? Maybe you onle y have to sustitute words in the Correction section. | | |
No, Ahmad wants to correct his source texts, not the typos he himself makes. By the way, than you for that, Wolfgang. I'll have to experiment with the macro recorder myself, too... | | |