Răspuns VBA translation function

  • יום שני 14 מאי 2012 06:26
     
      קוד כלול

    I want to create a simple vba function (in MS Project...) to translate on demand. I have a simple one I found on the web, but it returns question marks instead of the Chinese translation. I assume this is a "code page" issue or something like that. Can anyone help?

    Sub bingTranslate()
     languageFrom = "en": languageTo = "zh-chs": sText = "Thank you"
     ID = "708BEDCB01828123DC7B6C6A6AB12EF82DFBB611"
    sURL = "http://api.microsofttranslator.com/V2/Ajax.svc/Translate?oncomplete=&appId=" & ID + "&from=" & languageFrom + "&to=" & languageTo & "&text=" & sText
      Set oH = CreateObject("Microsoft.XMLHTTP")
      oH.Open "get", sURL, False
      oH.sEnd
      sresult = oH.responseText
      MsgBox oH.responseText
      Debug.Print sresult
    End Sub

    Thanks in advance.

    Jim

כל התגובות

  • יום שלישי 15 מאי 2012 14:28
     
     הצעה לתשובה

    The Bing AppID methodology has been deprecated. You'll have to use the Windows Azure Marketplace tokens to access translator.

    I have a VB (not VBA) sample here:

    http://social.msdn.microsoft.com/Forums/en-US/microsofttranslator/thread/3f9a270e-3360-4aa1-9eb8-669145298d45

    Hope that helps! :)



    //Laurence Moroney: www.netnavi.tv // Author of 'Introducing Silverlight' series and much more // @lmoroney

  • יום שלישי 15 מאי 2012 15:29
     
     תשובה

    The Bing AppID methodology has been deprecated. You'll have to use the Windows Azure Marketplace tokens to access translator.

    I have a VB (not VBA) sample here:

    http://social.msdn.microsoft.com/Forums/en-US/microsofttranslator/thread/3f9a270e-3360-4aa1-9eb8-669145298d45

    Hope that helps! :)



    //Laurence Moroney: www.netnavi.tv // Author of 'Introducing Silverlight' series and much more // @lmoroney



    • נערך על-ידי 祥皓 יום שלישי 15 מאי 2012 15:29
    • הוצע כתשובה על-ידי 祥皓 יום שלישי 15 מאי 2012 15:30
    • סומן כתשובה על-ידי JimS-Indy יום רביעי 11 יולי 2012 09:03
    •