如题,求各位达人解惑,先谢谢了!

解决方案 »

  1.   

    我有个思路“先取出对应frame的document,再取想要的元素”
    但是不知道怎么写,求帮助。
      

  2.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      wb1.Navigate('http://oa1.sihaigroup.cn:81/');
    end;procedure TForm1.btnCalcClick(Sender: TObject);
    var
      doc,framedoc : IHTMLDocument2;
      frame_dispatch: IDispatch;
      o,ole_index,oleObj: OleVariant;
      i,j: Integer;
    begin
      doc := wb1.Document as IHTMLDocument2;
      if doc = nil then Exit;
      for i := 0 to doc.frames.length - 1 do
      begin
        ole_index := i;
        frame_dispatch := doc.frames.item(ole_index);
        if frame_dispatch = nil then Continue;
        framedoc := (frame_dispatch as IHTMLWindow2).document;
        o :=wb1.oleobject.document.documentelement.document.frames.item(i).document.all.item('DATA_1',0);
        if VarIsEmpty(o) then
          Continue
        else
          o.value:='test';
      end;
    end; 
    到o.value:='test';这句就弹内存访问错误。求解