批次將 .doc 轉換為 .docx(與其他 Office 格式等效)?

批次將 .doc 轉換為 .docx(與其他 Office 格式等效)?

我希望將大量的 Office 文件轉換為較新的版本,例如。 .doc 到 .docx。我需要一些適用於所有不同 MS Office 應用程式檔案類型的東西。

最適合這項工作的工具是什麼(Windows xp)?

我正在尋找免費的東西(啤酒),並且可以管理大量文件(透過手動開啟文件來做到這一點是不可行的)。

謝謝。

答案1

答案是結構化的,可以轉換所有文檔,而不僅僅是 Word 文檔。

假設您的電腦上有大量以 Office XP 或 2003 編寫的 Excel 工作表、PowerPoint 簡報和 Word 文件。

一種選擇是在關聯的 Office 程式中開啟所有這些文件,然後手動將它們儲存為較新的(docx、xlsx 或 pptx)格式。或依照以下步驟一次轉換所有文件。

第1步:下載遷移管理器套件並將其解壓縮到一個新資料夾中 - 例如:c:\office。

辦公室包

第 2 步:下載並安裝辦公室包- 即使您的電腦上已安裝了 Microsoft Office 2007,也需要執行此步驟。

步驟 3:假設您將 Office Manager 檔案提取到 c:\office 目錄中,請前往 c:\office\tools,使用記事本開啟 ofc.ini 並新增下列行。

fldr=c:\使用者\labnol\文檔

這是指儲存 Office 檔案的資料夾位置。我將其指向我的文檔資料夾,但它在您的計算機上可能有所不同。

步驟 4:開啟命令提示字元並前往 c:\office\tools。在那裡您將看到一個名為 ofc.exe 的實用程式 - 這是 Office 文件轉換器,它將所有舊 Office 檔案批次轉換為新的 2007 Office 文件格式。跑步。

轉換文檔

該資料夾(和子資料夾)中的所有舊 Office 檔案將立即轉換為新格式並儲存在新資料夾中。

此實用程式適用於 Word(doc 到 docx)、Access 資料庫、PowerPoint(ppt 到 pptx)、Visio 圖表、Excel(xls 到 xlsx)和 Microsoft Project 檔案。但是,對於受密碼保護的文檔,轉換可能會失敗。

取自這裡

答案2

下列VBA宏將轉換選定資料夾中的所有文檔

Sub SaveAllAsDOCX()
Dim strFileName As String
Dim strDocName As String
Dim strPath As String
Dim oDoc As Document

With Dialogs(wdDialogCopyFile)
If .Display <> 0 Then
strPath = .Directory
Else
MsgBox "Cancelled by User"
Exit Sub
End If
End With

If Documents.Count > 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
If Left(strPath, 1) = Chr(34) Then
strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFileName = Dir$(strPath & "*.doc")

While Len(strFileName) <> 0
Set oDoc = Documents.Open(strPath & strFileName)

strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".docx"
oDoc.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatDocumentDefault
oDoc.Close SaveChanges:=wdDoNotSaveChanges
strFileName = Dir$()
Wend
End Sub

歸功於格雷厄姆市長 - Word MVP

答案3

批量轉換 DOC 為 DOCX

Microsoft 有一個批量轉換實用程序,可以將多個 DOC 檔案轉換為 DOCX 檔案。這篇部落格文章提供了有關其使用的非常基本的資訊。

答案4

我不能將此解決方案歸功於我,因為我是從微軟論壇。為了方便起見,重新發佈在這裡:

  1. 將所有 .doc 檔案放入一個資料夾,例如 **D:\doc**。

  2. 開啟 Word 並按Alt+F11開啟 VBA 編輯器。

  3. 現在點選「普通的” 項目並點選“插入” > “模組” 在專案中插入新模組。

  4. 雙擊模組開啟編輯區,貼上以下程式碼:

     Sub TranslateDocIntoDocx()
       Dim objWordApplication As New Word.Application
       Dim objWordDocument As Word.Document
       Dim strFile As String
       Dim strFolder As String
    
       strFolder = "D:\doc\"
       strFile = Dir(strFolder & "*.doc", vbNormal)
    
       While strFile <> ""
         With objWordApplication      
           Set objWordDocument = .Documents.Open(FileName:=strFolder &strFile, AddToRecentFiles:=False, ReadOnly:=True, Visible:=False)
    
           With objWordDocument
             .SaveAs FileName:=strFolder & Replace(strFile, "doc", "docx"), FileFormat:=16
             .Close
           End With
         End With
         strFile = Dir()
       Wend   
    
       Set objWordDocument = Nothing
       Set objWordApplication = Nothing
     End Sub
    
  5. 點擊 ”跑步“ 按鈕。幾秒鐘後,您會發現所有 .doc 檔案都已轉換為 .docx 檔案。原始 .doc 文件將保留。

相關內容