返回列表 上一主題 發帖

用excel上網查音標

本帖最後由 Hsieh 於 2010-7-22 13:11 編輯

回復 1# 自我感覺良好


   現在的yahoo字典音標已經改成文字
這樣更好辨識了
  1. Sub searchIT(Rng As Range)
  2.     Dim XH As Object
  3.     Dim shpRm As Shape
  4.     '清除已有的解釋及音標
  5.     With Rng.EntireRow
  6.         .Resize(1, .Columns.Count - 1).Offset(0, 1).Clear
  7.     End With
  8.     '開啟網頁
  9.     Set XH = CreateObject("Microsoft.XMLHTTP")
  10.     With XH
  11.         .Open "get", "http://tw.dictionary.yahoo.com/dictionary?p=" & Rng.Text, False
  12.         .send
  13.         On Error Resume Next
  14.         '摘取第一組中文翻譯
  15.         Rng.Offset(0, 2) = Split(Split(.responseText, "class=""description""><p>1.")(1), "<")(0)
  16.         '摘取KK音標
  17.         Rng.Offset(0, 1) = Left(VBA.Split(.responseText, "KK</span>  ")(1), InStr(VBA.Split(.responseText, "KK</span>  ")(1), "]"))
  18.         
  19.     End With
  20.     Rng.Select
  21. End Sub
複製代碼
yahoo_dictionary.rar (13.66 KB)
學海無涯_不恥下問

TOP

        靜思自在 : 屋寬不如心寬。
返回列表 上一主題