[算表] 大量地址翻譯

看板Office作者 (凝)時間4年前 (2020/03/24 16:50), 編輯推噓0(002)
留言2則, 1人參與, 4年前最新討論串1/1
大家好 最近工作上需要大量的地址中翻英 上網爬文後看到之前有高手寫了函數轉換 但不知道為何我始終帶不出英文地址出來,都顯示Value,一類的我實在查不出個頭緒 以下為代入的函數,想起厲害的高手協助看看哪裡需要修正,謝謝!! Public Function getCdit(strIn As Variant) As Variant Dim objXML Dim strResult As String Dim strResultFin As String Dim lngPosStart As Long Dim lngPosEnd As Long Set objXML = CreateObject("MSXML2.ServerXMLHTTP") objXML.Open "GET", "http://cdict.net/?q=" & strIn, False Call objXML.send strResult = objXML.responseText strResultFin = "" lngPosStart = InStr(1, strResult, "<div id='eng_addr'>", vbTextCompare) If lngPosStart > 0 Then lngPosEnd = InStr(lngPosStart, strResult, "</div>", vbTextCompare) strResultFin = Mid(strResult, lngPosStart + Len("<div id='eng_addr'>"), lngPosEnd - lngPosStart - Len("<div id='eng_addr'>")) End If getCdit = strResultFin Set objXML = Nothing End Function -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 211.75.177.223 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Office/M.1585039817.A.21B.html

03/24 17:13, 4年前 , 1F
測試巨集不用改,加個函數encodeurl
03/24 17:13, 1F

03/24 17:14, 4年前 , 2F
文章代碼(AID): #1UUSd98R (Office)