网上找了很多。使用IO读出来。一行行的画进去打印。但WORD里面有表格啊!

解决方案 »

  1.   

    直接调用Word//要添加Word的引用
    object nothing = System.Reflection.Missing.Value;
                       //Word文档路径
                        object filename = @"C:\ProductERP\" + ID.ToString() + ".docx";
                        Word.ApplicationClass ap = new Word.ApplicationClass();
                        Word.Document doc = ap.Documents.Open(ref filename, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing);
                        ap.Visible = true;
      

  2.   


    我得到这个WORD 怎么交给打印控件 PrintDocument ?
      

  3.   

    不知道 你是不是非要用PrintDocument 打印
    ap.Visible word就打开了  可以直接利用Word打印
      

  4.   

    现在的WORD文档就是生成的。现在需求要求加入打印。 不打开文档的情况下开始打印。
    如果直接用PrintDocument 去画。 可以实现。但是word表数量居多。而且格式不固定。
      

  5.   

    public void PrintOut()
      {
      object copies = "1";
      object pages = "";
      object range = WdPrintOutRange.wdPrintAllDocument;
      object items = WdPrintOutItem.wdPrintDocumentContent;
      object pageType = WdPrintOutPages.wdPrintAllPages;
      object oTrue = false;
      object oFalse = false;
      this.m_Document.PrintOut(
      ref oTrue, ref oFalse, ref range, ref missing, ref missing, ref missing,
      ref items, ref copies, ref pages, ref pageType, ref oFalse, ref oTrue,
      ref missing, ref oFalse, ref missing, ref missing, ref missing, ref missing);
      }
    使用编辑器