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,于是进行了一番尝 ...
随机推荐
- asp.net c# repeater或gridview导出EXCEL的详细代码。
Response.Clear(); Response.Charset = "GB2312"; Response.ContentEncoding = System.Text.Enco ...
- fork 至 “sys_clone" SyS_clone
注:glibc-2.17中fork的相应系统调用是sys_clone及SyS_clone.有人说调用的是sys_fork,但是我持否定意见,如果我们向真的来发起系统调用可以使用syscall. for ...
- 如何在eclipse中使用mvn clean install
1.在Maven项目或者pom.xml上右键——>Run As ——>“Maven Build...”或者Run Configuration——>“Maven Build” 2.在“ ...
- 2. 自动化运维系列之Cobbler给Openstack节点安装操作系统。
preface 我们在一篇博文知道了如何搭建Cobbler,那么下面就通过Cobbler来安抓Openstack所有节点吧. 服务器配置信息如下: 主机名 IP 角色 Cobbler.node.com ...
- UGUI表情系统解决方案
参考链接: https://blog.uwa4d.com/archives/Sparkle_UGUI.html http://tech.seasungame.com/blog/index.php/20 ...
- Linux中/etc/resolv.conf文件简析
https://blog.csdn.net/lcr_happy/article/details/54867510
- [Bayesian] “我是bayesian我怕谁”系列 - Exact Inference
要整理这部分内容,一开始我是拒绝的.欣赏贝叶斯的人本就不多,这部分过后恐怕就要成为“从入门到放弃”系列. 但,这部分是基础,不管是Professor Daphne Koller,还是统计学习经典,都有 ...
- c#POST请求php接口
POST请求php接口 /// <summary> /// 指定Post地址使用Get 方式获取全部字符串 /// </summary> /// <param name= ...
- 【笔试面试】神马搜索C++程序猿电话面试
面试时间:2015.07.15 预约时间:2015.07.14.电话面试前一天,会电话咨询你方面电话面试的时间. 面试环节: 无自我介绍(这是我面试这么多家公司碰到的第一次),直接面试内容. 问题1: ...
- Java -- 异常的捕获及处理 -- throws与throw关键字
7.2 throws 与 throw关键字 7.2.1 throws 关键字 在定义一个方法时可以使用throws关键字声明,使用throws声明的方法标识此方法不处理异常,而交给方法的调用处进行处理 ...