-
如何使用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
-
C++、MFC源代码observer
C++、MFC源代码observer-C, MFC source code observer
- 2023-07-11 01:35:04下载
- 积分:1
-
许可证选项文件,并可替换名为程序的用户。是否认为…
License Options file and may replace Named Users for a
Program, whether temporarily or not, no more than four (4)
times per year, prov
file never exceeds the number licensed per Program.
Portions of the Programs may be installed on individual
computers to accelerate startup times, as long as the-License Options file and may replace Named Users for a Program. whether temporarily or not. no more than four (4) times per year. 577 file never exceeds the number licensed per Program. Portions of the Programs may be instal led on individual computers to accelerate star tup times, as long as the
- 2022-12-16 11:35:03下载
- 积分:1
-
一个在EVC下写的动画显示程序,不同于GIF动画,不需要开线程...
一个在EVC下写的动画显示程序,不同于GIF动画,不需要开线程-under a written procedure animated show, unlike GIF animation, no open thread
- 2022-03-21 03:35:25下载
- 积分:1
-
这场比赛的良好做法
This Game for good practice
- 2022-01-26 07:30:05下载
- 积分:1
-
基于PXA270 嵌入式系统的Windows CE 引导程序设计.pdf
基于PXA270 嵌入式系统的Windows CE 引导程序设计.pdf-PXA270-based Windows CE embedded system to guide program design. Pdf
- 2022-03-02 02:22:16下载
- 积分:1
-
STM32库函数编写利用例程完成输入方波测频串口数码管显示(不作商业用途)
利用STM32的的输入捕获,完成输入方波的测频的任务,适合学习,易懂。
- 2022-08-26 14:54:57下载
- 积分:1
-
ASP、PHP、JSP、Oracle、MySQL、SQL Server基础知识可以参考http:/ / www. ..
ASP,PHP,JSP,Oracle,MySQL,SQL Server 知识库 可以参考 http://www.topronet.com/kb/kb.jsp-ASP, PHP, JSP, Oracle, MySQL, SQL Server knowledge base can reference http://www.topronet.com/kb/kb.jsp
- 2022-01-25 17:57:07下载
- 积分:1
-
lex yac 教程
lex yac 教程-lex yac course
- 2023-03-21 06:50:03下载
- 积分:1
-
将一个excel表中的数据导入到数据库中,在企业中非常普遍
将一个excel表中的数据导入到数据库中,在企业中非常普遍-Would be an excel table data into a database, is very common in the enterprise
- 2022-01-24 17:12:23下载
- 积分:1