2
我用下面的代碼填充ComboBox在Word 2003中微軟Word VBA,試圖從一個HTTP調用用數據填充組合框
Private Sub UserForm_Initialize()
ComboBox1.List = Array("Red", "Green", "Yellow", "Blue")
End Sub
我想什麼做的是獲取數據動態地通過http調用。這等功能似乎工作通過HTTP來獲取數據
Dim MyRequest As Object
Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
MyRequest.Open "GET", _
"http://localhost:8500/test7.htm"
' Send Request.
MyRequest.Send
'And we get this response
MsgBox MyRequest.ResponseText
test7.htm只包含
"Red", "Green", "Yellow", "Blue"
我希望把兩者結合起來,但低於不起作用
Private Sub UserForm_Initialize()
Dim MyRequest As Object
Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
MyRequest.Open "GET", _
"http://localhost:8500/test7.htm"
' Send Request.
MyRequest.Send
ComboBox1.List = Array(MyRequest.ResponseText)
End Sub
任何幫助的VBA小老鴨讚賞
工作過一種享受Arce,謝謝 – Saul 2011-01-22 20:19:20