I've looked through all other questions, plus many searches over the internet, and cannot find anything that works with my situation.
I have a macro that was developed in VBScript for IBM Personal Communications (PCOMM). My bosses want me to convert it so it can be used in Macro Express Pro (ME). ME is a WYSIWYG (what you see is what you get) editor that has preset functions and allows for external scripting of JScript, VBScript, and HTA.
The PCOMM macro is about 1000 lines of pure VBScript, so it only makes sense to keep it that way, however ME doesn't allow some things that PCOMM does, so some modifications need to be made.
One modification is there already is one global instance of Internet Explorer (IE), so the macro has been designed to use that instance. I'm trying to get the selected option of a drop down box, but everything I've tried has been unsuccessful.
Here's the HTML code:
<select name="ctl00$cphContent$ddlWorkQueue" onchange="javascript:setTimeout('__doPostBack(\'ctl00$cphContent$ddlWorkQueue\',\'\')', 0)" id="ctl00_cphContent_ddlWorkQueue" class="ddlbox">
<option selected="selected" value="5422">605</option>
<option value="5419">ACCUM</option>
<option value="5418">CORRESPONDENCE</option>
<option value="5415">FEKEY</option>
<option value="5416">NKPORTAL</option>
<option value="5420">PROVIDER</option>
<option value="5423">EDITS</option>
<option value="5421">TRACR</option>
<option value="5417">WAND</option>
</select>
As you can see, "605" is selected. I want to be able to display "605" in a message box. Here's the VBScript for this:
'This subroutine checks to see if the selected queue matches the ini value if it does not it updates the ini value
Sub SetQueue
Dim Selection
'Commented out by previous developer. We do not want to create a new instance of Internet Explorer. We want to use the existing instance...
'Set objIE = CreateObject("InternetExplorer.Application")
Selection = Document.getElementById("ctl00_cphContent_ddlWorkQueue").selectedIndex
MsgBox "Selection: " & Selection
End Sub
Hopefully someone can offer me some assistance and point me in the right direction. All I get when I run the macro is "Selection: ".