http://www.c-sharpcorner.com/Code/2002/Mar/WordFromDotNet.asp
解决方案 »
- (急切求助)请大家介绍下WebService、Socket及Proxy代理服务(在线等)
- 类似于下面这个switch语句,怎么写?
- 问个sql server的问题,关于text类型的拆分问题
- 询问---上海中智计算机技术服务有限公司
- 请问如何取将自定义控件中textarea的值传给属性Text??
- folderBrowserDialog 对话框 点击取消后 如何退出当前操作!!!
- 找不到ExplorerGUIDs的类型或名子空间
- 点击查看是出现的问题
- 不知是什么错误,所以要大家来帮忙!
- GridView的CommandField属性,为什么点击编辑按钮都会跳转到页面首部
- 求救:我用dataread 读取符合条件的记录,为何只能显示一条记录呢?在线等待!
- 疯了,一下午没有搞明白一个简单的问题:如何是一个窗体刚开始运行的时候不显示?
object pathName = FullPathFileName; try
{
//打开Word文档
Word.Document doc = wordapp.Documents.Open(ref pathName,ref Nothing,ref Nothing,
ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,
ref Nothing,ref Nothing);
Word.Table objTable =(Word.Table) doc.Tables.Item(1);
Word.Range objRange = (Word.Range) objTable.Cell(2,1).Range; string strRangeText = objRange.Text;
strRangeText = strRangeText.Replace(DocumentProcessConsts.FILENO_FIND_KEY, fileNo);
objRange.Text = strRangeText; // Word.Find objFind = (Word.Find) objRange.Find;
//
// objFind.ClearFormatting();
// objFind.Text = DocumentProcessConsts.FILENO_FIND_KEY;
// objFind.Replacement.ClearFormatting();
// objFind.Replacement.Text = fileNo;
// objFind.Execute(ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,
// ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,
// ref Nothing); doc.Save();
}
catch( Exception e)
{
throw e;
}
finally
{
quitWordApp(wordapp);
}就像这样就可以喽
Microsoft Word 2000
Microsoft Word 2002
For a Microsoft Visual Basic .NET version of this article, see Q316383 .
For a Microsoft Visual Basic 6.0 version of this article, see Q313193 .