博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Bulk Convert DOC to DOCX
阅读量:5742 次
发布时间:2019-06-18

本文共 3644 字,大约阅读时间需要 12 分钟。

  hot3.png

原文链接 :

帮助文档:

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速度很快,有一批文件似乎不成功率很高,用来做生产用,好像还达不到要求。

转载于:https://my.oschina.net/xxiu/blog/198552

你可能感兴趣的文章
人工智能还能干这些?这8种AI应用你可能意想不到
查看>>
实现Hyper-V 虚拟机在不同架构的处理器间迁移
查看>>
简单使用saltstack
查看>>
针对web服务器容灾自动切换方案
查看>>
突破媒体转码效率壁垒 阿里云首推倍速转码
查看>>
容器存储中那些潜在的挑战和机遇
查看>>
R语言的三种聚类方法
查看>>
55%受访企业将物联网战略视为有效竞争手段
查看>>
深入理解Python中的ThreadLocal变量(上)
查看>>
如果一切即服务,为什么需要数据中心?
查看>>
《游戏开发物理学(第2版)》一导读
查看>>
Erlang简史(翻译)
查看>>
深入实践Spring Boot2.4.2 节点和关系实体建模
查看>>
10个巨大的科学难题需要大数据解决方案
查看>>
Setting Up a Kerberos server (with Debian/Ubuntu)
查看>>
用 ThreadLocal 管理用户session
查看>>
setprecision后是要四舍五入吗?
查看>>
shiro初步 shiro授权
查看>>
上云就是这么简单——阿里云10分钟快速入门
查看>>
MFC多线程的创建,包括工作线程和用户界面线程
查看>>