请问如何使用C#读取word文档第一页并给页面截图?

解决方案 »

  1.   

    或则说如何使用C#对word文档第一页,第二页截图,有没有办法用C#只读取word文档的第一页的内容。
      

  2.   

    屏幕截图
    Word.ApplicationClass wordApp=new ApplicationClass();
    object file=path;
    object nullobj=System.Reflection.Missing.Value;   
    Word.Document doc = wordApp.Documents.Open(
    ref file, ref nullobj, ref nullobj,   
    ref nullobj, ref nullobj, ref nullobj,   
    ref nullobj, ref nullobj, ref nullobj,   
    ref nullobj, ref nullobj, ref nullobj);doc.ActiveWindow.Selection.WholeStory();
    doc.ActiveWindow.Selection.Copy();
    IDataObject data=Clipboard.GetDataObject();
    string str=data.GetData(DataFormats.Text).ToString();
    doc.Close();
      

  3.   

     Word.ApplicationClass app = null; 
     Word.Document doc = null; 
     object missing = System.Reflection.Missing.Value; 
     object FileName = Server.MapPath("123.doc");
    \ReadFromWordDoc\test.doc"; 
     object readOnly = true; 
     object isVisible = false; 
     try 
      { 
           app = new Word.ApplicationClass(); 
           doc = app.Documents.Open(ref FileName, ref missing, ref readOnly, ref     missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing); 
            string textString = doc.Content.Text; 
            Response.Write(textString); 
        }catch(Exception) 
        { 
            throw; 
         }
      

  4.   

     http://www.cnblogs.com/sunshine-anycall/archive/2009/08/22/1551974.html http://www.cnblogs.com/sunshine-anycall/archive/2009/08/25/1553273.html http://blog.felipel.com/post/Upload-and-Crop-Images-with-ASPNET-and-jCrop-Revisited!.aspx http://hi.baidu.com/%B4%F3%CE%B0/blog/item/4b40ba99b7c929036f068c5c.html http://kb.cnblogs.com/page/47074/这都是一些很好的程序截图例子。我就是按这个做的。
      

  5.   

     http://www.cnblogs.com/sunshine-anycall/archive/2009/08/22/1551974.html http://www.cnblogs.com/sunshine-anycall/archive/2009/08/25/1553273.html http://blog.felipel.com/post/Upload-and-Crop-Images-with-ASPNET-and-jCrop-Revisited!.aspx http://hi.baidu.com/%B4%F3%CE%B0/blog/item/4b40ba99b7c929036f068c5c.html http://kb.cnblogs.com/page/47074/这都是一些很好的程序截图例子。我就是按这个做的。