On Jun 19, 4:55 pm, "scripts.contac t" <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.checkboxE lement.onclick( )
and
objCB.onclick()
and VBA kept giving me an error message that it expects an = after the
expression.
So I tried
objCB.onclick() = "selectAllCheck boxes"
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.getElemen tById("selectAl lCB")
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 = "selectAllCheck boxes"
Call
docIE.parentWin dow.execScript( "javascript
:sel ectAllCheckboxe s",
"JavaScript ")
objCB.onclick() = "selectAllCheck boxes"
If you could drop-kick me a bit further down the road on this, I would
be very grateful.
Ed