|
楼主 |
发表于 2020-9-8 09:16
|
显示全部楼层
- Sub docx2doc() 'docx文件转doc文件
-
- Dim myDialog As FileDialog
- Set myDialog = Application.FileDialog(msoFileDialogFilePicker)
- Dim oFile As Object
- Dim oFilePath As Variant
-
- With myDialog
- .Filters.Clear '清除所有文件筛选器中的项目
- .Filters.Add "所有 WORD2007 文件", "*.docx", 1 '增加筛选器的项目为所有doc文件
- .AllowMultiSelect = True '允许多项选择
- If .Show = -1 Then '确定
- For Each oFilePath In .SelectedItems '在所有选取项目中循环
- Set oFile = Documents.Open(oFilePath)
- oFile.SaveAs FileName:=Replace(oFilePath, "docx", "doc"), FileFormat:=0
- oFile.Close
- Next
- End If
-
- End With
- End Sub
复制代码 |
|