C#读取WorD表格中的数据

object missing = System.Reflection.Missing.Value;
object savech=WdSaveOptions.wdDoNotSaveChanges ;
mydoc=wordApp.Documents.Open(ref myobj,ref missing,ref myfalse,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref mytrue,ref missing,ref missing,ref missing,ref missing);

  Word.Table mytable=mydoc.Tables[i];

//开始读取表格宽高,数据等

mytable.Rows.Count; //表行数

//Word.Range myRange; //RANGE对象

myRange = mytable.Rows[0].Cells[0].Range.Text.ToString();

   if (mydoc!=null)
   {
    mydoc.Close(ref savech,ref missing,ref missing);
   }


你可能感兴趣的:(C#,c#,object,null)