-
如何使用DocX 库在 .DOCX 文件中替换一列单词
翻译 maninwest@Codeforge 作者:B. Clay Shannon@Codeproject使用 DocX 库替换 .docx 文件中的字任务我想替换英式英语的拼写为美式口语。例如, 替换 "colour" 为 "color", "centre" 为 "center", "plough" 为"plow", 等。我可以使用查找>替换来一个一个地替换,但是很麻烦。所以,我找到一个库 。为了使用这个 docx库,只需从 这里 下载(docx.dll)。在你的项目中添加到它的引用,然后添加此 using子句:using Novacode;
首先需要加载具有”错误"拼写的文档:string filename = string.Empty;
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
filename = openFileDialog1.FileName;
}
else
{
MessageBox.Show("No file selected - hasta la vista and Ciao, baby!");
return;
}
using (DocX document = DocX.Load(filename))
{
document.ReplaceText("travelled", "traveled");
document.Save();
}
我们当然想以此完成所有词汇替换。首先,我们需要有一列单词,这样编码: 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
- 2022-01-25 21:24:19下载
- 积分:1
-
Bezier曲线
Bezier曲线的算法生成基于vc++的实现 -Bezier curve-based algorithm vc++ Realize the
- 2022-02-14 22:10:02下载
- 积分:1
-
时间转换成音档读出来,要自己做基本的音档,在程序的目录下,建个waves目录,这个是d...
时间转换成音档读出来,要自己做基本的音档,在程序的目录下,建个waves目录,这个是d-time for a change in the sound file as read out, it has to do basic sound file, in the process of the directory, build a directory waves, this is a d
- 2023-03-31 23:25:04下载
- 积分:1
-
无线传感器网络的贪婪路由
这个
- 2022-12-28 22:20:04下载
- 积分:1
-
这是一个可以供大家安装使用的软件,有好多的功能,我真的是没的上传了...
这是一个可以供大家安装使用的软件,有好多的功能,我真的是没的上传了-This is one everyone can use the software installation, there were a lot of features, I really had not upload
- 2022-01-25 23:07:41下载
- 积分:1
-
MiniHex is an open source, compact and practical hexadecimal editor.
MiniHex是一款开放源代码的、小巧而实用的十六进制编辑器。-MiniHex is an open source, compact and practical hexadecimal editor.
- 2022-02-24 16:09:57下载
- 积分:1
-
shortest distance
求两点间最近路径,以地图为例。查找两地间最短路径。-shortest distance
- 2022-06-13 17:56:20下载
- 积分:1
-
演示如何使用VB防止进程被结束,保护进程
演示如何使用VB防止进程被结束,保护进程-Demonstrates how to use VB to prevent the process is over, to protect the process of
- 2023-02-10 13:50:03下载
- 积分:1
-
绝对的好资料,大家一定要注意哦!! 绝对的好资料,大家一定要注意哦...
绝对的好资料,大家一定要注意哦!! 绝对的好资料,大家一定要注意哦-Absolute good information, we must pay attention to Oh! ! Absolute good information, we must pay attention to Oh! ! Absolute good information, we must pay attention to Oh! !
- 2022-01-28 00:28:51下载
- 积分:1
-
朋友,完整的应用程序代码,算法,有趣的河
朋友的VC完整应用程序代码 有意思的过河算法-friends VC complete application code algorithm interesting river
- 2023-08-15 01:15:04下载
- 积分:1