-
如何使用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
-
err
《C#入门经典2005》实例的源代码和习题答案-err
- 2022-01-25 18:59:36下载
- 积分:1
-
client chat program, and server
客户端的聊天程序,与服务器端的聊天程序相呼应,希望一并下载,-client chat program, and server-side chat program echoes the hope that together download,
- 2022-03-10 05:58:27下载
- 积分:1
-
Bayes classification of source code under windows
bayes分类 windows下的源程序-Bayes classification of source code under windows
- 2022-02-12 15:09:44下载
- 积分:1
-
Designing windows calculator usin VB
Designing windows calculator usin VB
- 2022-05-13 08:29:59下载
- 积分:1
-
支持向量机回归分析
利用基于神经网络的matlab中的toolbox工具箱实现回归分析,给定一组特定的输入与期望输出,通过神经元间的相互作用,调整权值和偏差。
- 2022-03-18 14:13:33下载
- 积分:1
-
Using c language realize electrical simulation
用c语言实现电机仿真-基于恒定磁链的转子磁链控制。-Using c language realize electrical simulation- based on a constant flux of the rotor flux control.
- 2023-08-10 22:45:03下载
- 积分:1
-
可以说是自己写编程以来第一个真正由自己做的小东西..请大家给点支持...
可以说是自己写编程以来第一个真正由自己做的小东西..请大家给点支持-can be programmed to write his first one truly doing the small things .. Please support to the point
- 2022-03-28 20:36:31下载
- 积分:1
-
简单文本编辑程序,功能一般,其他的也没什么可说
简单文本编辑程序,功能一般,其他的也没什么可说-Simple text editing program, function normally, the other has nothing to say
- 2022-08-19 06:31:58下载
- 积分:1
-
SSM简单增删改查
普通SSM增删改查,使用的是java语言,数据库是mysql,myeclipse工具开发。
- 2022-12-03 20:55:04下载
- 积分:1