-
如何使用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
-
WDF解包工具 WDF解包工具 WDF解包工具 WDF解包工具 WDF解包工具
WDF解包工具 WDF解包工具 WDF解包工具 WDF解包工具 WDF解包工具 -wdf Resource Kit readerwdf Resource Kit readerwdf Resource Kit readerwdf Resource Kit readerwdf Resource Kit readerwdf Resource Kit reader
- 2022-01-25 20:12:20下载
- 积分:1
-
这是一个计算器的源程序,这个程序可实现计算器模拟实验.
这是一个计算器的源程序,这个程序可实现计算器模拟实验.-This is a calculator of the source, this procedure could realize simulation calculator.
- 2022-06-20 15:16:34下载
- 积分:1
-
using_flash_glut.zip
using_flash_glut.zip
- 2023-04-23 04:10:03下载
- 积分:1
-
vc commonly used data format conversion, such as wchar_t, char*, CString, int, e...
vc中常用数据格式转换,如wchar_t,char*,CString,int等。-vc commonly used data format conversion, such as wchar_t, char*, CString, int, etc..
- 2023-01-12 13:25:03下载
- 积分:1
-
个人编写的一些类(单链表,栈等)
个人编写的一些类(单链表,栈等)-prepared by the individual category (single linked list, stack, etc.)
- 2022-03-17 17:17:21下载
- 积分:1
-
EVC Programming Microsoft Windows CE Dot N ET Code : main elements : a total of...
EVC Programming Microsoft Windows CE Dot NET 代码:
主要内容:
一共23章,EVC下编程源代码-EVC Programming Microsoft Windows CE Dot N ET Code : main elements : a total of 23 chapters under EVC programming source code
- 2022-08-06 13:28:42下载
- 积分:1
-
VFP报时小程序,小例子,大家看看,可能会有帮助,好了
VFP报时小程序,小例子,大家看看,可能会有帮助,好了-VFP timekeeping small programs, small examples, we see that may be helpful, a good
- 2023-04-08 04:35:04下载
- 积分:1
-
poj1010sticks源代码,欢迎大家下载
poj1010sticks源代码,欢迎大家下载-poj1010sticks source code, welcome you to download
- 2023-07-26 19:15:03下载
- 积分:1
-
一个著名的ftp搜索器可以很快地搜到著名的网站和大量的资源...
一个著名的ftp搜索器可以很快地搜到著名的网站和大量的资源-a famous ftp search engine will be able to search the famous website and a lot of resources
- 2022-05-06 11:18:07下载
- 积分:1