-
如何使用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
-
MFC Insider (book distribution source CHAP
MFC技术内幕(配书源码CHAP-MFC Insider (book distribution source CHAP
- 2023-02-15 19:05:03下载
- 积分:1
-
Join a very good vocabulary, study section of the friends can see you under Oh,...
很好的考研词汇,考研的朋友的可以看你下哦,保证你爽死了-Join a very good vocabulary, study section of the friends can see you under Oh, guarantee that you爽死the
- 2022-02-22 07:48:03下载
- 积分:1
-
COLORREC 算法的实现,包括实验源程序以及实验报告,大家多多支持啊...
3-COLORREC 算法的实现,包括实验源程序以及实验报告,大家多多支持啊-3-COLORREC algorithm, including the experimental source, as well as experimental reports, everyone can support ah
- 2022-07-24 19:12:19下载
- 积分:1
-
这是一个监控程序,可以运行其他小程序,这是描述的…
这是一个运行其他监控程序的小程序,对其进行了详细的描述,可以任意控制其他程序作为停止运行的工具
- 2022-04-01 23:21:23下载
- 积分:1
-
bank savings system source code! We hope that the support! Thank you for assessi...
银行储蓄系统源代码!希望大家支持!谢谢大家给于评价!-bank savings system source code! We hope that the support! Thank you for assessing!
- 2022-02-05 00:09:21下载
- 积分:1
-
Visual C#中的MDI编程
Visual C#中的MDI编程-Visual C# MDI programming
- 2022-07-20 07:14:20下载
- 积分:1
-
矩阵计算,主要是利用一个函数得到结果。全选主元高斯消去法...
矩阵计算,主要是利用一个函数得到结果。全选主元高斯消去法-Matrix calculations, mainly using a function to get results. Select principal component Gaussian elimination method
- 2022-12-08 20:00:03下载
- 积分:1
-
编译原理 语法分析器,能够对语句进行语法的分析和判断
编译原理 语法分析器,能够对语句进行语法的分析和判断-it is a good thing ,can indentify vocabililies.
- 2022-06-15 05:08:00下载
- 积分:1
-
大数加法的详细实现过程.
包括链表的使用.并做了cpu单次运算的优化.
实现单个响应周期内运算量的最优...
大数加法的详细实现过程.
包括链表的使用.并做了cpu单次运算的优化.
实现单个响应周期内运算量的最优-Addition of large numbers of details to achieve the process. Including the use of linked lists. And has done a single cpu optimize operations. To achieve a single cycle in response to the optimal computation
- 2022-04-01 18:13:52下载
- 积分:1