批量Doc轉docx
打開Word,Alt+F11,插入\模組,貼上以下內容,然後運行
Sub doc2docx() ‘doc文件轉docx文件
Dim myDialog As FileDialog, oFile As Variant
Set myDialog = Application.FileDialog(msoFileDialogFilePicker)
With myDialog
.Filters.Clear ‘清除所有檔篩選器中的專案
.Filters.Add “所有 WORD97-2003 檔”, “*.doc”, 1 ‘增加篩選器的項目為所有WORD97-2003檔
.AllowMultiSelect = True ‘允許多項選擇
If .Show = -1 Then ‘確定
For Each oFile In .SelectedItems ‘在所有選取項目中迴圈
With Documents.Open(oFile)
.SaveAs FileName:=Replace(oFile, “doc”, “docx”), FileFormat:=12
.Close
End With
Next
End If
End With
End Sub
發佈留言