public void OpenWord01()
{
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word._Application oWord;
Microsoft.Office.Interop.Word._Document oDoc;
oWord = new Microsoft.Office.Interop.Word.Application();
oWord.Visible = false;
object fileName = @"D:\1.docx";
oDoc = oWord.Documents.Open(ref fileName,
ref oMissing, true, false, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
false, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
string str = oDoc.Content.Text;
MessageBox.Show(str);
}
c#读取word内容
最新推荐文章于 2023-12-25 16:40:54 发布