Note that there are some explanatory texts on larger screens.

plurals
  1. POConvert symbols in MS Word
    primarykey
    data
    text
    <p>I have documents written in old Kazakh font (Kazakhstan), using win98. Nowadays we are using Times New Roman, but this font shows strange unicode characters. I can use substitution (Ctrl + H) to change all symbols to Times New Roman encoding, but we have 42 (84 in both cases) letters.</p> <p>For example I have all symbols from old font in first line, and all symbols from new font at the second line in the same order. </p> <p>Can someone write an example script that will read this two lines char by char, making something like a dictionary in Java then do a global substitution. </p> <p><strong>Update</strong></p> <p>Thanks Roman Plischke!</p> <p>I wrote a macro that recursively applies to all *.doc files in some folder.</p> <pre><code>Sub Substitution() ' ' Substitution of the chars from font Times/Kazakh ' to Times New Roman ' Chars to substitute are 176-255 bytes, 73 and 105 byte Dim sTab As String sTab = "£ª½¥¡¯Ž¼º¾´¢¿žÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" Selection.Find.Font.Shadow = False Selection.Find.Replacement.Font.Shadow = False For i = 1 To Len(sTab) With Selection.Find .Text = ChrW(i + 175) .Replacement.Text = Mid(sTab, i, 1) .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = True .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Text = Selection.Find.Text Next i Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = ChrW(105) .Replacement.Text = "³" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = True .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Text = Selection.Find.Text With Selection.Find .Text = ChrW(73) .Replacement.Text = "²" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = True .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Text = Selection.Find.Text ' kazakh language Selection.WholeStory Selection.LanguageID = WdLanguageID.wdKazakh Application.CheckLanguage = False Selection.Collapse Direction:=wdCollapseStart End Sub ' Function that Call Substitution() for all documents ' in folder vDirectory Sub LoopDirectory() Dim vDirectory As String Dim oDoc As Document vDirectory = "E:\soft\Dedushka\not\" vFile = Dir(vDirectory &amp; "*.doc") Do While vFile &lt;&gt; "" Set oDoc = Documents.Open(FileName:=vDirectory &amp; vFile) Debug.Print ActiveDocument.Name + " Started" Call Zamena Debug.Print ActiveDocument.Name + " Finish" oDoc.Close SaveChanges:=True vFile = Dir Loop End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload