由于word的文件太大 ,所以要将word分割,word的每页要生成一个新的word
这是读取原来word指定页的代码:
  public Range ReadPage(int page)
        {
            object wordPath = "e:\\test.docx";
   
            object missing = Type.Missing;            object currentPage = 1;
      
            ApplicationClass appc = new ApplicationClass();
            Type wordType = appc.GetType();
            Documents docs = appc.Documents;
            Type docsType = docs.GetType();
            Document doc = (Document)docsType.InvokeMember("Open",
               System.Reflection.BindingFlags.InvokeMethod, null, docs, new object[] {wordPath,true,true
               }
                );
            object objWhat = WdGoToItem.wdGoToPage;
            object objWhich = WdGoToDirection.wdGoToAbsolute;            WdStatistic sta = WdStatistic.wdStatisticPages;
            int iPage = doc.ComputeStatistics(sta, ref missing);//Word页°3数oy            Range range1 = doc.GoTo(ref objWhat, ref objWhich, ref currentPage);
            Range range2 = range1.GoToNext(WdGoToItem.wdGoToPage);            object start = range1.Start;
            object end = range2.Start;
            return  doc.Range(ref start, ref end);
        }
这是生成新word的代码
Application wordApp = new ApplicationClass();            object file = @"E:\test.docx";
            object nullobj = System.Reflection.Missing.Value;            //打开文件
            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);       
            object Nothing = Type.Missing;
            object savefile = @"E:\test1.docx";            object missing = Type.Missing;            Document WordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);            var para = WordDoc.Range();
            para  = ReadPage(1);
        
            WordDoc.SaveAs(ref savefile, 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);
          
            doc.Close(ref nullobj, ref nullobj, ref nullobj);
            wordApp.Quit(ref nullobj, ref nullobj, ref nullobj);
            GC.Collect();
            GC.WaitForPendingFinalizers();
现在的问题是 如果word页中只含有文本 不包含图片 那么把  para  = ReadPage(1);改为       para.Text = ReadPage(1).Text;就可以重新生成了 但是word中 是包含图片的 所以我想将读取页返回的range对象 直接赋值给para 但是保存下来之后 word是空的 求解!