S
S
Sanjar Aubakirov2013-11-11 18:39:53
ASCII
Sanjar Aubakirov, 2013-11-11 18:39:53

Converting old text?

Good day to all!
I'll start from afar. My grandfather is a professor, he writes books in MS Word on Win 98. The computer is old, the Kazakh font that he uses, too. At that time, no one knew what Unicode was, a lot of Kazakh fonts with blackjack were divorced, etc. Grandfather asked me to transfer all the books to the new computer. the old one ran out of space, but there they open with krakozyabry. I would like to convert all his books to the new Times New Roman so that they can be easily published in the future. It would be possible to do this with Ctrl + H.
Help me write a macro (for Office 2007 if it matters) that could do this. Here is a link to the folder where the very old Kazakh fonts and a small piece of one of the books are located.
Asked a similar question onstackoverflow , maybe the answer I was given will give someone the right idea.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanzhar Aubakirov, 2013-11-11
@c0rp

working version

Sub Zamena()
'
' Zamena Макрос
'
'
Dim sTab As String
    sTab = "ӘҒҚҢӨҰҮҺәғқңөұүһАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
    Selection.Find.ClearFormatting
    Selection.Find.Font.Shadow = True
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Shadow = False
    With Selection.Find
        .Text = ""
        .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.Font.Shadow = False
    Selection.Find.Replacement.Font.Shadow = True
    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

I
ipswitch, 2013-11-11
@ipswitch

You can install Adobe Acrobat 4.0 or 5.0 on an old computer, convert everything to PDF. Safety will be "for centuries", and no problems with fonts.
and write new books differently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question