On Jun 19, 4:55 pm, "scripts.contact" <scripts.cont...@gmail.com>
wrote:
Ed wrote:
I'm writing a VBA macro in Word 2003 that finds and manipulates a web
page (Win XP, IE6 sp2). I am having trouble with a checkbox. I can
find the checkbox and make it checked, but I can't figure out how to
activate the function connected to the OnClick event. Would anyone be
able to help me out here, please?
checkboxElement.onclick()
I tried
objCB.checkboxElement.onclick()
and
objCB.onclick()
and VBA kept giving me an error message that it expects an = after the
expression.
So I tried
objCB.onclick() = "selectAllCheckboxes"
which is the name of the function called by the onClick event, and
still nothing happened. (Checking this one box activates a function
which checks all boxes on the page.)
Here's what I've got so far:
Dim objCB
Set objCB = docIE.getElementById("selectAllCB")
objCB.Checked = True ' This does check the box, but only this box.
' None of these activate the function to select all the boxes.
objCB.onclick = "selectAllCheckboxes"
Call
docIE.parentWindow.execScript("javascript
:selectAl lCheckboxes",
"JavaScript")
objCB.onclick() = "selectAllCheckboxes"
If you could drop-kick me a bit further down the road on this, I would
be very grateful.
Ed