1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33:
| function TVPlanParser.GetSelectbox(aDoc: IHTMLDocument2): boolean;var Disp: IDispatch; SelEl: IHTMLSelectElement; i: Integer; OptionEl: IHTMLOptionElement; option_ids: array of WideString; option_texts: array of WideString; begin Disp:=(aDoc as IHTMLDocument2).all.item('element', EmptyParam);
(Disp as IHTMLElement2).focus;
if Assigned(Disp) and Supports(Disp, IHTMLSelectElement, SelEl) then begin SetLength(option_ids, SelEl.length); SetLength(option_texts, SelEl.length); for i:=0 to SelEl.length-1 do begin OptionEl := SelEl.Item(i,EmptyParam) as IHTMLOptionElement; showmessage(OptionEl.Value); option_ids[i] := OptionEl.Value; option_texts[i] := OptionEl.Text; end; end; end; |