Bulk Convert DOC to DOCX
原文链接 :http://blogs.msdn.com/b/ericwhite/archive/2008/09/19/bulk-convert-doc-to-docx.aspx
帮助文档:http://technet.microsoft.com/library/cc179019(office.12).aspx
Microsoft has a bulk conversion utility that can convert multiple DOC files to DOCX files. This blog post presents very basic information on its use. This utility has been around for a while, but a fair number of people don’t know of its existence. Because it’s a powerful tool designed to convert all files on a server (or even a bunch of servers), its use is a little cryptic. This is fine for IT professionals, but if all you want to do is bulk convert a single directory of DOC files, this post shows what you need to do.
Before you can use this tool, you need to install the Microsoft Office Compatibility Pack. While the compatibility pack is primarily used with Office 2003 to allow it to load and save Open XML files, in essence, the compatibility pack is comprised of file format converters, which the Office File Converter (OFC) uses. To use OFC, you need to install the compatibility pack even if you only have Office 2007 installed. Download the compatibility pack here.
Next, you need to download and install the Microsoft Office Migration Planning Manager (OMPM). This contains a bunch of stuff, but for bulk file conversion, we are primarily interested in just one tool, OFC.EXE. Download the Microsoft Office Migration Planning Manager here.
When installing, as usual, you will select the installation directory. OFC.EXE is in the Tools directory under the installation directory. In addition, in that directory, there is a sample OFC.INI file. To run OFC.EXE, you need to create an OFC.INI, and place it in the directory where you run OFC.EXE from.
For my simple example, I want to convert all DOC files found in the C:\Users\ericwhit\Documents\08-09-19-Doc, and place the converted DOCX files in C:\Users\ericwhit\Documents\08-09-19-Docx. Here is the OFC.INI file for this scenario:
[Run]
LogDestinationPath=C:\Users\ericwhit\Documents\08-09-19-Conversion-Log
TimeOut = 3
[ConversionOptions]
; FullUpgradeOnOpen: if set to 1, Word documents will be fully converted to the OpenXML format
; if set to 0 (default), Word documents will be saved in the OpenXML format in compatibility mode
FullUpgradeOnOpen=1
CABLogs=0
MacroControl=0
[FoldersToConvert]
fldr=C:\Users\ericwhit\Documents\08-09-19-Doc
[ConversionInfo]
SourcePathTemplate=********************
DestinationPathTemplate=C:\Users\ericwhit\Documents\08-09-19-Docx
The SourcePathTemplate and DestinationPathTemplate provide extremely flexible configuration for bulk conversion of a large number of directories. They allow an IT professional to, say, convert files from one entire server, place the converted files on a different server, and use various sub-paths of the path of the source document to form the path where the DOCX will be placed. Fully configuring SourcePathTemplate and DestinationPathTemplate is beyond the scope of this blog post. The configuration above basically specifies to just take all of the DOC files in the specified fldr directory, and place them in the specified DestinationPathTemplate directory.
So, place a modified version of the above INI file in some directory, and run OFC.EXE from that directory. You will see something like this:
D:\ofc\Tools>ofc.exe
Microsoft Office File Converter version 12.0.4518.1032
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
Automatically converts Office documents to 2007 Microsoft Office system file for
mat based on settings in the OFC.INI control file.
Your newly created DOCX files will be in the directory you specified in DestinationPathTemplate.
这玩意似乎不是很好用,在处理ppt的时候直接死在那了,然后就关闭了,处理word速度很快,有一批文件似乎不成功率很高,用来做生产用,好像还达不到要求。
Bulk Convert DOC to DOCX的更多相关文章
- word文档转pdf,支持.doc和.docx,另附抽取pdf指定页数的方法
公司有个需求,需要将word转成pdf并且抽取首页用以展示,word文档有需要兼容.doc和.docx两种文档格式.其中.docx通过poi直接就可以将word转成pdf,.doc则无法这样实现,上网 ...
- 文件在线预览doc,docx转换pdf(一)
文件在线预览doc,docx转换pdf(一) 1. 前言 文档转换是一个是一块硬骨头,但是也是必不可少的,我们正好做的知识库产品中,也面临着同样的问题,文档转换,精准的全文搜索,知识的转换率,是知识库 ...
- 基于java 合并.doc和docx格式的Word文件
注:摘录自 https://www.cnblogs.com/shenzhouyh/articles/7243805.html 之前用过jacob 合并.doc,但是是有jacob有弊端: 服务器必须是 ...
- C#仪器数据文件解析-Word文件(doc、docx)
不少仪器数据报告输出为Word格式文件,同Excel文件,Word文件doc和docx的存储格式是不同的,相应的解析Word文件的方式也类似,主要有以下方式: 1.通过MS Word应用程序的DCOM ...
- java使用poi读取doc和docx文件
这几天在学习java io流的东西,有一个网友看到博客后问了一个问题,就是说他的doc文档为什么用我所说的方法死活就是乱码. 我一开始以为是他方法问题,结果自己试了之后发现和他的结果一样也是乱码. 于 ...
- Python:读取 .doc、.docx 两种 Word 文件简述及“Word 未能引发事件”错误
概述 Python 中可以读取 word 文件的库有 python-docx 和 pywin32. 下表比较了各自的优缺点. 优点 缺点 python-docx 跨平台 只能处理 .docx 格式 ...
- 使用Lucene对doc、docx、pdf、txt文档进行全文检索功能的实现
转载请注明出处:http://blog.csdn.net/dongdong9223/article/details/76273859 本文出自[我是干勾鱼的博客] 这里讲一下使用Lucene对doc. ...
- 在word中doc与docx的区别是什么(整理)
在word中doc与docx的区别是什么(整理) docx 是Office2007使用的,是用新的基于XML的压缩文件格式取代了其目前专有的默认文件格式,在传统的文件名扩展名后面添加了字母x(即.do ...
- java使用poi读取doc和docx文件(maven自动导入依赖包)
java使用poi读取doc和docx文件(maven自动导入依赖包) 于是在网上搜寻了一阵之后才发现原来doc文档和excel一样不能用普通的io流的方法来读取,而是也需要用poi,于是进行了一番尝 ...
随机推荐
- APP投资 历史 十万到 十亿元的项目
马云又投了课程表APP 1亿元. 还能输入106字 http://www.tuicool.com/articles/ARVN3qI#0-qzone-1-41007-d020d2d2a4e8d1a3 ...
- 【转帖】Linux发行版:CentOS、Ubuntu、RedHat、Android、Tizen、MeeGo
Linux发行版:CentOS.Ubuntu.RedHat.Android.Tizen.MeeGo作者:阳光岛主 原文在这儿 Linux,最早由Linus Benedict Torvalds在199 ...
- sql产生随机时间
--建立过程 CREATE PROCEDURE GetTime @BeginTime VARCHAR(5), @EndTime VARCHAR(5), @RandTime VA ...
- VC获得本机网络连接状态
/本机网络连接类型(成功) #define NET_TYPE_RAS_DIAL_UP_CONNECT_NET 0x01 //上网类型:采用RAS拨号连接上网 0x01 ...
- Android 编程下的代码混淆之(android-support-v4.jar)
项 目在代码混淆过程中如果引用了第三方 Jar 包,需要在混淆的脚本文件中加入第三方 Jar 包的声明.部分第三方 Jar 包虽然在混淆脚本中进行了声明,但是在混淆过程中经常会发现内部类或者引用文件找 ...
- JVM垃圾回收机制之引用类型
一:引用的类型 javac编译器编译源文件后,生成字节码文件,在类加载器加载字节码文件到内存中时,在内存中开辟 空间,栈.堆以及方法区,来存放对象以及引用.引用可以分为四种: 强引用:平常我们在编写程 ...
- SQL Server 2008 清空删除日志文件 130G日志 10秒内变10M
SQL2005: Backup Log DNName with no_log '这里的DNName是你要收缩的数据库名,自己注意修改下面的数据库名,我就不再注释了. go dump transact ...
- UML类图关系(转,添加了实例)
UML类图关系(泛化 .继承.实现.依赖.关联.聚合.组合) 在UML类图中,常见的有以下几种关系: 泛化(Generalization), 实现(Realization),关联(Associati ...
- 删除ORACLE目录OCI.dll文件无法删除 (转)
删除ORACLE目录OCI.dll文件无法删除 今天准备把虚拟机里的10g卸载安装11g来研究一些新特性 卸载没有用自带的UnInstall工具之前看warehouse的讲课视频凭记忆手动卸载了下删除 ...
- 【Android】录音暂停和继续
https://www.2cto.com/kf/201410/347839.html http://blog.csdn.net/wanli_smile/article/details/7715030 ...