مترجم جوجل عن طريق أتمتة إنترنت إكسبلورر

هذا الماكرو VBA قانون يترجم النص باستخدام مترجم جوجل عن طريق أتمتة إنترنت إكسبلورر للرقابة من خلال إكسل.

تفسير

برنامج يكتب النص تلقائيا من اكسل في إنترنت إكسبلورر ويستخدم خدمة ترجمة جوجل لترجمة النص إلى اللغة الرغبات. فمن الممكن لترجمة من وإلى العديد من اللغات المختلفة ، فقط تغيير رمز اللغة ، ويتم تعيين برنامج يصل وفقا لذلك. اليوم جميع لغات رئيسية هي المتاحة باستخدام مترجم جوجل. وهو واحد من قلة الخدمات التي تمكن من ترجمة جمل كاملة وليس فقط الكلمات. هذه الخدمة مجانية ويمكن تنفيذها من خلال المعهد. التكنولوجيا الدقيقة المستخدمة في الترجمة ليست عامة. بدأت جوجل لترجمة صفحات الويب كاملة على شبكة الانترنت وكذلك عند استخدام وظيفة البحث جوجل.

وVBA كامل برنامج اكسل / يتوفر للتحميل في أسفل هذه الصفحة ، تمتع!

رمز

Public Sub Google_Translate()

Dim Google_Translate_Internet_Explorer_Automation As Object
Set Google_Translate_Internet_Explorer_Automation = CreateObject("InternetExplorer.Application")
Google_Translate_Internet_Explorer_Automation.Navigate "http://translate.google.com/translate_t#"
Google_Translate_Internet_Explorer_Automation.Visible = True
Wait_Between_Google_Translate_Cycles = Range("G1").Value

Column = 0
While Range("f9").Offset(0, Column).Value <> tom

    Do While Google_Translate_Internet_Explorer_Automation.busy
        Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
    Loop
   
    to_language_code = Range("f9").Offset(0, Column).Value

    Do While Google_Translate_Internet_Explorer_Automation.busy
        Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
    Loop

    Google_Translate_Internet_Explorer_Automation.document.forms("text_form").elements(5).Value = to_language_code

    Do While Google_Translate_Internet_Explorer_Automation.busy
        Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
    Loop

    rad = 0
    While Range("c10").Offset(rad, 0).Value <> tom

        If Range("f10").Offset(rad, Column).Value = tom Then

            from_language_code = Range("a10").Offset(rad, 0).Value
            Google_Translate_Internet_Explorer_Automation.document.forms("text_form").elements(4).Value = from_language_code

            Do While Google_Translate_Internet_Explorer_Automation.busy
                Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
            Loop

            Google_Translate_Text = Range("c10").Offset(rad, 0).Value

            While Google_Translate_Internet_Explorer_Automation.busy
                Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
            Wend

            Google_Translate_Internet_Explorer_Automation.document.forms("text_form").elements("source").Value = Google_Translate_Text

            While Google_Translate_Internet_Explorer_Automation.busy
                Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
            Wend

            Google_Translate_Internet_Explorer_Automation.document.getElementById("text_form").submit

            While Google_Translate_Internet_Explorer_Automation.busy
                Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
            Wend

            dd2 = Google_Translate_Internet_Explorer_Automation.document.forms(1).elements(4).Value

            While Google_Translate_Internet_Explorer_Automation.busy
                Call WaitSeconds(Wait_Between_Google_Translate_Cycles)
            Wend

            Google_Translate_Variable1 = Replace(dd2, Chr(13), "")
            Range("f10").Offset(rad, Column).Value = Google_Translate_Variable1

        End If

        rad = rad + 1
    Wend

    Column = Column + 1
Wend

Google_Translate_Internet_Explorer_Automation.Quit
Set Google_Translate_Internet_Explorer_Automation = Nothing

End Sub

Public Sub WaitSeconds(sek)

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + sek
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

End Sub


 

 

 

تنزيل ملف اكسل!Google_Translate_Internet_Explorer_Automation.xls

 

Add your comment

Your name:
Subject:
Comment: