In VBA is it possible to intercept a javascript onchange event and grab the originating ID# in the webbrowser control?
<select name="status0" id="status0" onchange="javascriptonchangeeventhere">
The above code is a combobox demo, If I were to select an item from the combobox, it would process onchange in javascript. What it does is pull up a form containing current date and reference number, instead I would like to pull up my own userform and then spit that data into a related (notes0) field. How would I intercept this when it occurs so I can assign it to the correct field.
Here’s a short example. Project references set for “Microsoft HTML object library” and “Microsoft internet controls”
In a class module “clsEvents”:
In a regular module:
If you run the
Setupsub and then change the value of the second select or click the “Javascript” link on the page in IE you should see output in the Immediate window of the VB editor.Hope that helps get you started.