【文件属性】:
文件名称:WORD OFFICE vba :docx转pdf、doc、rtf、txt
文件大小:1011B
文件格式:TXT
更新时间:2022-05-06 10:07:31
office vba
'docx转pdf、doc、rtf、txt
Option Explicit
Sub docx2other()
On Error Resume Next
Dim sEveryFile As String,sSourcePath As String,sNewSavePath As String
Dim CurDoc As Object
sSourcePath = "E:\DOCX文件\"
'假定待转换的docx文件全部在"E:\DOCX文件\"下,你需要按实际情况修改。
sEveryFile = Dir(sSourcePath &"*.docx")
Do While sEveryFile <> ""
Set CurDoc = Documents.Open(sSourcePath & sEveryFile, , , , , , , , , , , msoFalse)
sNewSavePath = VBA.Strings.Replace(sSourcePath & sEveryFile, ".docx", ".pdf")
'如果想导出doc/rtf/txt等,就把上一行行