替换来一个一个地替换,但是很麻烦。所以,我找到一个库。为了使用这个docx库,只需从这里下载(docx.dll)。在你的项目中添加到它的引用,然后添加此using子句:usingNovacode;首先需要加载具有”错误"拼写的文档:stringfilename=string.Empty;DialogResultresult=openFileDialog1.ShowDialog();if(result==DialogResult.OK){filename=openFileDialog1.FileName;}else{MessageBox.Show("Nofileselected-hastalavistaandCiao,baby!");return;}using(DocXdocument=DocX.Load(filename)){document.ReplaceText("travelled","traveled");document.Save();}我们当然想以此完成所有词汇替换。首先,我们需要有一列单词,这样编码: 请点击左侧文件开始预览!预览只提供20%的代码片段,完整代码需下载后查看加载中侵权举报-IMDN开发者社群-imdn.cn"> 替换来一个一个地替换,但是很麻烦。所以,我找到一个库。为了使用这个docx库,只需从这里下载(docx.dll)。在你的项目中添加到它的引用,然后添加此using子句:usingNovacode;首先需要加载具有”错误"拼写的文档:stringfilename=string.Empty;DialogResultresult=openFileDialog1.ShowDialog();if(result==DialogResult.OK){filename=openFileDialog1.FileName;}else{MessageBox.Show("Nofileselected-hastalavistaandCiao,baby!");return;}using(DocXdocument=DocX.Load(filename)){document.ReplaceText("travelled","traveled");document.Save();}我们当然想以此完成所有词汇替换。首先,我们需要有一列单词,这样编码: 请点击左侧文件开始预览!预览只提供20%的代码片段,完整代码需下载后查看加载中侵权举报 - IMDN开发者社群-imdn.cn">
登录
首页 » Windows开发 » 如何使用DocX 库在 .DOCX 文件中替换一列单词

如何使用DocX 库在 .DOCX 文件中替换一列单词

于 2022-01-25 发布 文件大小:58.41 kB
0 155
下载积分: 2 下载次数: 1

代码说明:

翻译  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%的代码片段,完整代码需下载后查看 加载中 侵权举报

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 程序调试信息送与接收
    程序调试信息发送与接收-program debugging information send and receive
    2022-01-23 11:26:49下载
    积分:1
  • 这是一个SDK程序。本程序跟踪显示鼠标的坐标位置,同时,若有鼠标操作,可在窗口标题栏中显示操作信息,要是在窗口客户区中进行双击,就会在双击位置点上显示位置信息。...
    这是一个SDK程序。本程序跟踪显示鼠标的坐标位置,同时,若有鼠标操作,可在窗口标题栏中显示操作信息,要是在窗口客户区中进行双击,就会在双击位置点上显示位置信息。此外,客户中还有两个位图,当鼠标移动到位图上时,就会改变为自己定义的光标。该程序适合Win32编程初学者,内含大量的中文注释。-SDK This a process. This program tracking shows the coordinates of the mouse position, and if the mouse operation, the window title bar shows operating information, if the window area for customers double-click, double-click will be the point location shown on the location information. In addition, customers there are two bitmap, when the mouse movement on the plan in place, they will change their definition of the cursor. The program suitable for beginners Win32 programming, with a lot of Chinese Notes.
    2022-03-19 01:22:51下载
    积分:1
  • vc++在操作系统的应用 vc++在操作系统的应用
    vc++在操作系统的应用 vc++在操作系统的应用-vc in the operating system application in vc application of operating system
    2022-08-06 08:36:48下载
    积分:1
  • 《面向对象程序设计》 练习11的源代码
    《面向对象程序设计》 练习11的源代码- Object-oriented programming, the source code of practice 11
    2022-06-21 08:28:34下载
    积分:1
  • 为了让用户方便地通过程序访问某个网站,需要采用具有超级链接功能的控件。本程序设计了一个具有超级链接功能的控件。...
    为了让用户方便地通过程序访问某个网站,需要采用具有超级链接功能的控件。本程序设计了一个具有超级链接功能的控件。-In order to allow users to easily access through a Web site, require the use of hyperlinks with the control function. This procedure is designed with a hyperlink control function.
    2022-12-24 15:10:03下载
    积分:1
  • 基于VC++ 6.0 MFC 的网络通信聊天程序设计源代码
    基于VC++ 6.0 MFC 的网络通信聊天程序设计源代码-Based on VC 6.0 MFC chat network communication programming source code
    2022-01-26 05:17:42下载
    积分:1
  • 欢迎使用月影飞狐游戏修改器
    欢迎使用月影飞狐游戏修改器--内存修改 v1.0 (目前只支持 win 2k/xp/2003 系统) 本程序包含3个可执行文件, Gamer.exe Gamerdll.dll GameRun.exe .Gamer.exe的源 代码在Gamer目录下,Gamerdll.dll的源代码在Gamerdll目录下,GameRun.exe的源代码在GameRun 目录下,其中Gamer.exe为主程序文件,Gamerdll.dll是动态连接库,GameRun.exe为游戏自修改补 丁,支持游戏Directx模式下直接弹出,热键是小键盘的 * 键,对于不能在directx模式下弹出的游戏, 可以按小键盘的 - 键弹出主程序界面,然后选择游戏进程进行修改.在源代码目录中.rap文件为 RadAsm集成开发环境的工程文件. 程序使用 100% Win32 汇编语言程序设计,3个执行文件合起来才42K的大小,共4451行汇编源 代码(不算资源文件). 月影飞狐游戏修改器以windows进程和线程环境知识为基础,以完全独创的搜索算法为 手段,其中使用了PE(可执行文件)文件结构,windows结构化异常处理(SEH)技术,使得其搜索 速度和金山公司的金山游侠相差无几,而且搜索的精度高于金山游侠,支持模糊搜索,可以生成 游戏自修改补丁程序. 目前月影飞狐游戏修改器已经在星际争霸等游戏上测试通过.但在内存占用超过100M的游戏 中不够稳定. -welcomed the use of video on flying fox-game changes-- changes v1.0 memory (currently only supports the win 2k/x p/2003 system) the procedures contained three executable files, Gamer.exe Gamerdll.dll GameRun.exe. Gamer.e xe in the source code directory Gamer, Gamerdll.dll the source code in Gamerdll directory, GameRun.exe the source code in
    2022-07-13 03:54:11下载
    积分:1
  • 多维数据库处理控件DYNACUBE
    多维数据库处理控件DYNACUBE-multidimensional database handling controls DYNACUBE
    2022-07-22 01:40:25下载
    积分:1
  • The program of dll test can examine the effect from dll file.
    dll测试的文件可以把dll文件的效果进行查看-The program of dll test can examine the effect from dll file.
    2022-02-07 20:42:06下载
    积分:1
  • 文件编辑器的C++实现,包括多个实用头文件
    文件编辑器的C++实现,包括多个实用头文件-File editor of C++ implementation, including a number of practical header files
    2022-03-03 14:35:58下载
    积分:1
  • 696518资源总数
  • 106222会员总数
  • 14今日下载