一个aspx页面,有一些TextBox文本框,如何将文本框的内容点击导出按钮时,导出到word上,最好也能导出图片的。有例子的麻烦说下,万分感谢。!

解决方案 »

  1.   

    function AllAreaWord()
    {
      var oWD = new ActiveXObject("Word.Application");
      var oDC = oWD.Documents.Add("",0,1);
      var orange =oDC.Range(0,1);
      var sel = document.body.createTextRange();
      sel.moveToElementText(PrintA);
      sel.select();
      sel.execCommand("Copy");
      orange.Paste();
      oWD.Application.Visible = true;
    }读取textbox 内容
    COM操作
    操作WORD文件addpicture添加图片mydoc.ActiveWindow.ActivePane.Selection.InlineShapes.AddPicture("C:\\test.jpg", ref oMissing, ref oMissing, ref oMissing);
    http://topic.csdn.net/u/20101226/11/7a3ea6e4-e2b5-4a6a-80c6-53c4785fda1e.html