嗨,我尝试了不同的方法,但没有成功。谁能弄清楚如何在此按钮上激活事件:
<b>Class="palette" Title="Tilføj"
onclick ="paletteAdd('databank_form_frekvens_dualListBox_choices',
'databank_form_frekvens_dualListBox_selection',
'databank_form_frekvens_dualListBox_recorder');"
img src=
"/jobindsats/viewer/resources/com.sas.jobindsats.ui.palette.Palette/add.gif"
alt = "Tilføj".</b>
到目前为止,代码单击第一页上的两个按钮并激活/选择第二页上的所有变量。但我似乎无法单击将所选值从左侧框发送到右侧框的单个箭头按钮。问题是他们都有相同的名字、头衔等。唯一的区别是 onclick 事件...
代码:
Sub makro()
Dim IE As Object
Dim frm As Object
Dim elc As HTMLHtmlElement
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.navigate "http://www.jobindsats.dk/sw167.asp"
Do Until .readyState = 4: DoEvents: Loop
End With
frm.document.getElementByID("form_gruppe_maalingsgrupper_0_maalinger_1_radio").Click
Application.Wait DateAdd("s", 1, Now)
frm.document.getElementByID("nextbutton").Click
Application.Wait DateAdd("s", 1, Now)
'Ledighedstype
frm.document.all("databank_form_forcedDimensions_0_placeholder_dual_choices").Options(1).Selected = True
Application.Wait DateAdd("s", 2, Now)
'doesnt work
Set elc = frm.document.all.Title("Tilføj")
For Each elc In frm.document.all
If elc.onclick = "form_gruppe_maalingsgrupper_0_maalinger_1_radio" Then
elc.Click
End If
Next
End Sub