メインコンテンツへスキップ

Wordで.doc形式のファイルを.docxにバッチ変換する方法は?

97-2003形式のWord文書を受け取ったとすると、これらすべての.doc形式の文書を一度に.docx形式にバッチ変換するにはどうすればよいでしょうか。 この記事では、この問題を解決するXNUMXつの方法を紹介します。

.doc形式のファイルをVBAコードを使用して.docxにバッチ変換します
Kutools for Wordを使用して、.doc形式のファイルを.docxにバッチ変換します


.doc形式のファイルをVBAコードを使用して.docxにバッチ変換します

このセクションでは、指定したフォルダー内のすべての.doc形式のドキュメントを一度に.docxドキュメントに変換するVBAコードについて説明します。 次のようにしてください。

1.指定したフォルダに.docxに変換するすべての.doc形式のドキュメントを収集してください。

2。 プレス 他の + F11 キーを開く アプリケーション向け Microsoft Visual Basic 窓。

3.ウィンドウで、をクリックします インセット > モジュール。 次に、以下のVBAコードをモジュールウィンドウにコピーします。

VBAコード:特定のフォルダー内のすべての.doc形式のドキュメントを.docxにバッチ変換します

Sub ConvertDocToDocx()
'Updated by ExtendOffice 20181128
    Dim xDlg As FileDialog
    Dim xFolder As Variant
    Dim xFileName As String
    Application.ScreenUpdating = False
    Set xDlg = Application.FileDialog(msoFileDialogFolderPicker)
    If xDlg.Show <> -1 Then Exit Sub
    xFolder = xDlg.SelectedItems(1) + "\"
    xFileName = Dir(xFolder & "*.doc", vbNormal)
    While xFileName <> ""
        Documents.Open FileName:=xFolder & xFileName, _
            ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
            PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
            WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
            wdOpenFormatAuto, XMLTransform:=""
        ActiveDocument.SaveAs xFolder & Replace(xFileName, "doc", "docx"), wdFormatDocumentDefault
        ActiveDocument.Close
        xFileName = Dir()
    Wend
    Application.ScreenUpdating = True
End Sub

4。 プレス F5 コードを実行するためのキー。 オープニングで ブラウズ ウィンドウで、.doc形式のドキュメントが含まれているフォルダを選択してクリックします OK。 スクリーンショットを参照してください:

次に、以下のスクリーンショットに示すように、すべての.doc形式のドキュメントがすぐに.docxドキュメントに変換されます。


Kutools for Wordを使用して、.doc形式のファイルを.docxにバッチ変換します

このセクションでは、便利なユーティリティをお勧めします。 とともに Doc / Docx の有用性 Kutools for Word、フォルダ内のすべての.doc形式のドキュメントを.docxドキュメントに簡単に変換できます。 次のようにしてみてください。

Kutools for Word :100以上の便利なWordアドインで、 制限なしで無料で試すことができます 60.

1.指定したフォルダにすべての.doc形式のドキュメントを収集してから、をクリックしてください クツールズプラス > Doc / Docx。 スクリーンショットを参照してください:

2。 の中に ドキュメントフォーマットコンバーター ダイアログボックスでは、次のようにする必要があります。

2.1).doc形式のドキュメントが含まれているフォルダを選択します ソースファイルフォルダ セクション;
2.2)選択 ドキュメントをdocxに変換する フォーマット変換 ドロップダウンリスト;
2.3)デフォルトでは、 ソースと同じ宛先パス ボックスがチェックされています。 変換されたすべての.docxドキュメントを同じフォルダーに配置する場合は、このオプションを選択したままにします。
.docxドキュメントとソース.docドキュメントを分離する場合は、チェックを外してください。 ソースと同じ宛先パス ボックスをクリックし、新しいフォルダを選択して.docxドキュメントを に保存 ボックス;
2.4)をクリックします 開始 ボタン。 スクリーンショットを参照してください:

3.次に、正常に変換されたドキュメントの数を示すダイアログボックスが表示されたら、[ OK ボタンを押して閉じます ドキュメントフォーマットコンバーター 窓。

これで、すべての.doc形式のドキュメントが.docxファイルに変換されます。 スクリーンショットを参照してください:

このユーティリティの無料トライアルをご希望の場合は、 ソフトウェアを無料でダウンロード まず、上記の手順に従って操作を適用します。


最高のオフィス生産性向上ツール

Kutools for Outlook - Outlook を強化する 100 以上の強力な機能

🤖 AIメールアシスタント: AI の魔法を備えたインスタント プロのメール - ワンクリックで天才的な返信、完璧な口調、多言語の習得。メールを簡単に変革しましょう! ...

📧 自動メール: 不在時 (POP および IMAP で利用可能)  /  メール送信のスケジュール設定  /  メール送信時のルールによる自動CC/BCC  /  自動転送 (高度なルール)   /  あいさつを自動追加   /  複数受信者の電子メールを個別のメッセージに自動的に分割する ...

📨 電子メール管理: メールを簡単に思い出す  /  件名などで詐欺メールをブロック  /  重複するメールを削除する  /  高度な検索  /  フォルダーを統合する ...

📁 アタッチメント プロバッチ保存  /  バッチデタッチ  /  バッチ圧縮  /  自動保存   /  自動デタッチ  /  自動圧縮 ...

🌟 インターフェースマジック: 😊もっと可愛くてクールな絵文字   /  タブ付きビューで Outlook の生産性を向上  /  Outlook を閉じる代わりに最小化する ...

???? ワンクリックの驚異: 受信した添付ファイルをすべてに返信する  /   フィッシングメール対策  /  🕘送信者のタイムゾーンを表示 ...

👩🏼‍🤝‍👩🏻 連絡先とカレンダー: 選択したメールから連絡先を一括追加  /  連絡先グループを個別のグループに分割する  /  誕生日のリマインダーを削除する ...

オーバー 100の特長 あなたの探索をお待ちしています! ここをクリックして詳細をご覧ください。

 

 

Comments (14)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Dobrý den,
já bych potřeboval, ale VBA script který by fungoval včetně podsložek. Umíte někdo prosím upravit i tento skript? Děkuji.

ENG:
Good day,
I would need a VBA script that would work including subfolders. Can someone please edit this script as well? Thank you.
This comment was minimized by the moderator on the site
Hi Daniel Beneš,
To include subfolders, please try the following VBA code.
After adding the code, go to the Tools tab, click References, in the opening References - Project dialog box, check the Microsoft Scripting Runtime box, and then click the OK button to save the changes. See the following screenshot:
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/check-scripting_runtime.png
After that, press the F5 key to run the code.

Sub ConvertDocToDocx()
'Updated by ExtendOffice 20221124
  Dim xDlg As FileDialog
  Dim xFldPath As Variant
  Dim xFileName As String
  On Error Resume Next
  Application.ScreenUpdating = False
  Set xDlg = Application.FileDialog(msoFileDialogFolderPicker)
  If xDlg.Show <> -1 Then Exit Sub
  xFldPath = xDlg.SelectedItems(1) + "\"
  Call ListAllFiles(xFldPath)
  Application.ScreenUpdating = True
End Sub

Function ListAllFiles(FldPath)
  Dim xFSO As FileSystemObject
  Dim xFolder As Folder
  Dim xSubFolder As Folder
  Dim xNewName As String
  On Error Resume Next
  xFileName = Dir(FldPath & "*.doc", vbNormal)
  While xFileName <> ""
    xNewName = VBA.Left$(xFileName, VBA.InStrRev(xFileName, "doc") - 1) & "docx"
    Documents.Open FileName:=FldPath & xFileName, _
        ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
        PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
        WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
        wdOpenFormatAuto, XMLTransform:=""
    ActiveDocument.SaveAs FldPath & xNewName, wdFormatDocumentDefault
    ActiveDocument.Close
    xFileName = Dir()
  Wend
  Set xFSO = CreateObject("Scripting.FileSystemObject")
  Set xFolder = xFSO.GetFolder(FldPath)
  For Each xSubFolder In xFolder.SubFolders
    Call ListAllFiles(xSubFolder.Path + "\")
  Next
  Set xFSO = Nothing
  Set xFolder = Nothing
End Function
This comment was minimized by the moderator on the site
Nice tool but I got the problem, that I can't convert DOC files (written in capitals!) into docx files.
It works with doc files.
This comment was minimized by the moderator on the site
Hi,
The following code can help to convert both doc. and DOC. files into docx files. Please give it a try. Thanks for your feedback.

Sub ConvertDocToDocx()
'Updated by ExtendOffice 20220506
    Dim xDlg As FileDialog
    Dim xFolder As Variant
    Dim xFileName As String
    Application.ScreenUpdating = False
    Set xDlg = Application.FileDialog(msoFileDialogFolderPicker)
    If xDlg.Show <> -1 Then Exit Sub
    xFolder = xDlg.SelectedItems(1) + "\"
    xFileName = Dir(xFolder & "*.doc", vbNormal)
    While xFileName <> ""
        Documents.Open FileName:=xFolder & xFileName, _
            ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
            PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
            WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
            wdOpenFormatAuto, XMLTransform:=""
        ActiveDocument.SaveAs xFolder & Replace(VBA.LCase(xFileName), "doc", "docx"), wdFormatDocumentDefault
        ActiveDocument.Close
        xFileName = Dir()
    Wend
    Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
Thanks for sharing
This comment was minimized by the moderator on the site
best graphic design company in india
Designing is a craft of communicating words as articulations. Visuals matter more than words in the advanced field.
The experts in the designing business recommend that illustrations are simpler to recall than words,
and that is the reason Website designing and Graphics play an imperative job.

This comment was minimized by the moderator on the site
Thanks for sharing this useful information.
This comment was minimized by the moderator on the site
This is really insightful article , found it very helpful and informational
This comment was minimized by the moderator on the site
HelloNice post .. Keep sharing.Thank You
This comment was minimized by the moderator on the site
Hello sir,
I love with this post.I really appreciate for this website.Your information is so good and valuable.Lovable idea and concept for sharing this website.
This is an amazing website.This post is nice.
Thanks for sharing
This comment was minimized by the moderator on the site
Hi....Hi, This blog content very technical information, it is on of the best blog i have got. Very interesting and describe in a very easy way.
This comment was minimized by the moderator on the site
Hello,
I am glad to find this useful information Thanks for sharing this amazing article.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations