如何将memo里的东西写到网页上的textarea里
我是新手入门,希望有热心的朋友能指点一下~

解决方案 »

  1.   

    哪的memo呀,你说得清楚点,
    要是Application和Ie通讯,很难做到的
      

  2.   

    就是随便哪个form的memo啊
    具体是这样:
    窗体上有一个form,一个按扭
    然后点一下按钮,把memo的东西复制到网页上的textarea里
    就是这样,虽然我知道很简单,但我是新手,没接触过,所以希望有人能帮忙给讲解一下
    分数一定送上
      

  3.   

    我记得vb下可以找到页面里这个控件的句柄,然后把内容写进去,delphi不行吗?
      

  4.   

    //容易,以本贴为例
    uses ShDocVw, MSHtml, ActiveX;procedure TForm1.Button1Click(Sender: TObject);
    const
      bbs = 'http://expert.csdn.net/Expert/topic/2101/2101191.xml?temp=.208172';
    var
      Win: IShellWindows;
      Web: IWebBrowser2;
      doc: IHtmlDocument2;
      form: IHtmlFormElement;
      textarea: IHTMLTextAreaElement;
      itemname, itemindex: OleVariant;
      I: Integer;
    begin
      Win := CoShellWindows.Create;
      try
        // 枚举所有ie窗口
        for I := 0 to Win.Count - 1 do
        begin
          Web := Win.Item(I) as IWebBrowser2;
          Log(Web.LocationURL);
          if Web.LocationURL = bbs then
          begin
            Web.Document.QueryInterface(IHtmlDocument2, doc);
            itemname := 'XmlRePly';
            doc := (IDispatch(doc.frames.item(itemname)) as IHtmlWindow2).document as IHtmlDocument2;
            itemindex := 0;
            form := doc.forms.item(itemname, itemindex) as IHtmlFormElement;
            itemname := 'ReplyContent';        
            textarea := form.item(itemname, itemindex) as IHtmlTextAreaElement;
            textarea.value := Memo1.Text;
          end;
        end;
      finally
        Win := nil;
      end;
    end;procedure TForm1.Log(msg: String);
    begin
      Memo1.Lines.Add(msg);
    end;