try
using System.IO;
StreamReader sr = new StreamReader("YourFileName", System.Text.Encoding.GetEncoding("GB2312"));String s = sr.ReadToEnd();sr.Close();
using System.IO;
StreamReader sr = new StreamReader("YourFileName", System.Text.Encoding.GetEncoding("GB2312"));String s = sr.ReadToEnd();sr.Close();
具体参考这个:string xx,yy;
Word.ApplicationClass oWord = new Word.ApplicationClass();
Word.Document oDoc;
Word.Range oRange;
Word.Table otable;
Word.Selection oselection;
object a = Missing.Value;
object b = Missing.Value;
object filename=@"c:\test.doc";
oDoc = oWord.Documents.Open(ref filename,ref a,ref a,ref a,ref
//or oDoc = oWord.Documents.Add(ref a,ref a,ref a,ref a);
a,ref a,ref a,ref a,ref a,ref a,ref a,ref a);
oWord.Visible = true;
oDoc = oWord.ActiveDocument
oRange = oDoc.Range(ref a,ref b);
oRange.Rows.Count = 9;
oRange.Select;
xx =oRange.Text;
otable = oDoc.Tables.Item(1);
otable.Select;
yy = otable.Cell(0,1).Range.Text;
添加word的引用(2000是word9,XP是word10)然后: 参考这些:
http://groups.google.com/groups?q=C%23+word&hl=en&selm=mGUtR1GwBHA.1532%40cpmsftngxa09&rnum=4