7
我試圖在VB腳本中創建一個下拉/組合框。按我的理解,我們需要爲Internet Explorer創建一個實例,並創建一個下拉/組合框,這樣的事情:在VB腳本中顯示一個下拉/組合框
set oIE = createObject("InternetExplorer.Application")
with oIE
.Navigate "about:blank"
Do until .ReadyState = 4 : WScript.Sleep 100 : Loop
set oDoc = .document
.Visible = true
end with
with oDoc
.open
.writeln "<html><head><title>ComboBox Example</title></head>"
.writeln "<body scroll=no><object "
.writeln "classid=clsid:8BD21D30-EC42-11CE-9E0D-00AA006002F3"
.writeln "id=ComboBox1 width=400></object><p>"
.writeln "</body></html>"
.close
Do until .ReadyState = "complete" : WScript.Sleep 100 : Loop
set oComboBox1 = .all.ComboBox1
end with
with oComboBox1
.List = Array("One", "Two", "Three", "Four")
.AutoWordSelect = true
.focus
end with
oDoc.parentWindow.opener = "Me"
bClosing = false
on error resume next
do until bclosing: wsh.sleep 100 : loop
oIE.quit
sub Closing : bClosing = True : end sub
是否有可能不使用IE創建一個村落,下/組合框,類似於消息框或輸入框?
[值得一試](http://www.veretennikov.org/WSO/) – 2013-04-16 16:04:02