.net 读word中文字方法
Word.ApplicationClass app = null;
??????? Word.Document doc = null;
??????? object missing = System.Reflection.Missing.Value;
??????? object FileName = Server.MapPath("http://www.cnblogs.com/UpLoad/YJQX/YJYAGL/無標題文檔002746.doc");//@"E:\學習試驗項目\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);
??????????? lblContent.Text = textString.ToString();
??????? }
??????? catch (Exception)
??????? {
??????????? throw;
??????? }
轉載于:https://www.cnblogs.com/mzoylee/archive/2009/09/24/1573236.html
總結
以上是生活随笔為你收集整理的.net 读word中文字方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Oracle监听器Server端与Cli
- 下一篇: ASP.NET2.0通用数据访问类