将大量docm转换为docx [英] Convert a lot of docm to docx

查看:208
本文介绍了将大量docm转换为docx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在尝试将大量文档转换为docx

我在msdn上找到了一个脚本(http://code.msdn.microsoft.com/Office-2010-Converting-734b8209#content)



该脚本非常适合转换一个文件,但我不知道如何批量转换...



脚本需要一个输入文件名(我试过* .docm>不工作)

Hi there,

I'm trying to convert a lot of docm to docx
I've found a script on msdn (http://code.msdn.microsoft.com/Office-2010-Converting-734b8209#content)

The script works great for a conversion for one file, but I don't know how to batch the conversion...

The script need an input file name (i've try *.docm > not working)

Sub Main()
        WDConvertDOCMtoDOCX("C:\temp\MyFile.docm")
    End Sub





您有什么想法吗?



非常感谢

Kreg



Do you have an idea ?

Many thanks
Kreg

推荐答案

您需要列出文件夹中的所有文件,然后再调用转换函数,其中转换意味着:

1.打开现有文档

2.另存为docx

3.关闭





如需了解更多信息,请参阅:

如何:枚举目录和文件 [ ^ ]

如何:以编程方式打开现有文档 [ ^ ]

如何:以编程方式保存文档 [ ^ ] - 您需要调用 SaveAs方法 [ ^ ]正确 FileFormat [ ^ ]输入参数。

如何:以编程方式关闭文档 [ ^ ]
You need to list all files in the folder and then to call convert function, where convert means:
1. Open existing document
2. SaveAs docx
3. Close


For futher information, please, see:
How to: Enumerate Directories and Files[^]
How to: Programmatically Open Existing Documents[^]
How to: Programmatically Save Documents[^] - you need to call SaveAs method[^] with proper FileFormat[^] input parameter.
How to: Programmatically Close Documents[^]


这篇关于将大量docm转换为docx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆