如何读取word某一行的字数,paragraph和range都不行 就是要一行的。 不是要一段的字数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 word文档你的页面宽一点,一行就的字就多一点,窄一点就少一点,你怎么取... 设置书签,获取rangeWord.ApplicationClass wordApp=new ApplicationClass();object file=path;object nullobj=System.Reflection.Missing.Value; Word.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);doc.ActiveWindow.Selection.WholeStory();doc.ActiveWindow.Selection.Copy();IDataObject data=Clipboard.GetDataObject();string str=data.GetData(DataFormats.Text).ToString();doc.Close(); C#跨线程调用COM对象问题 求~~存储过程及视图 注册表问题 关于c#中的问题 SqlDataReader读取数值错误 求助,IE编程方面的高手!! 如何得到xsl转换xml的结果 winForm中执行中有一个错误提示,点忽略,程序能良好运行,怎么能不出现这个提示,或在程序用MessageBox提示!! (100分)WinForm ListBox数据源绑定自定义对象集合 倾全囊之分710征咒3721变态狂(二) 在按钮的单击事件中,如何引用按钮自已呢?是用按钮的名字好,还是sender好呢? checkbox控件的 checkstate 属性如何赋值呀?
Word.ApplicationClass wordApp=new ApplicationClass();
object file=path;
object nullobj=System.Reflection.Missing.Value;
Word.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);doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data=Clipboard.GetDataObject();
string str=data.GetData(DataFormats.Text).ToString();
doc.Close();