Μετάβαση στο κύριο περιεχόμενο

Πώς να μετατρέψετε μαζικά αρχεία μορφής .doc σε .docx στο Word;

Ας υποθέσουμε ότι έχετε λάβει περίπου έγγραφα μορφής 97-2003 Word, πώς μπορείτε να μετατρέψετε μαζικά όλα αυτά τα έγγραφα μορφής .doc σε μορφή .docx ταυτόχρονα; Αυτό το άρθρο θα σας δείξει δύο μεθόδους για την επίλυση αυτού του προβλήματος.

Μαζική μετατροπή αρχείων μορφής .doc σε .docx με κώδικα VBA
Μαζική μετατροπή αρχείων μορφής .doc σε .docx με Kutools για Word


Μαζική μετατροπή αρχείων μορφής .doc σε .docx με κώδικα VBA

Αυτή η ενότητα θα σας δείξει τον κωδικό VBA για να μετατρέψετε όλα τα έγγραφα μορφής .doc σε έναν καθορισμένο φάκελο σε έγγραφα .docx ταυτόχρονα. Κάντε τα εξής:

1. Συλλέξτε όλα τα έγγραφα μορφής .doc που θα μετατρέψετε σε .docx σε έναν καθορισμένο φάκελο.

2. Πάτα το άλλος + F11 για να ανοίξετε το Microsoft Visual Basic για εφαρμογές παράθυρο.

3. Στο παράθυρο, κάντε κλικ στο Κύριο θέμα > Μονάδα μέτρησης. Στη συνέχεια, αντιγράψτε κάτω από τον κώδικα VBA στο παράθυρο Module.

Κωδικός 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 αμέσως όπως φαίνεται στο παρακάτω στιγμιότυπο οθόνης.


Μαζική μετατροπή αρχείων μορφής .doc σε .docx με Kutools για Word

Ένα πρακτικό βοηθητικό πρόγραμμα θα προταθεί σε αυτήν την ενότητα. Με το Έγγραφο / Docx χρησιμότητα του Kutools για το Word, μπορείτε εύκολα να μετατρέψετε όλα τα έγγραφα μορφής .doc σε ένα φάκελο σε έγγραφα .docx. Δοκιμάστε το παρακάτω.

Kutools για το Word : Με περισσότερα από 100 εύχρηστα πρόσθετα Word, δωρεάν δοκιμή χωρίς περιορισμό 60 ημέρες.

1. Συλλέξτε όλα τα έγγραφα μορφής .doc σε έναν καθορισμένο φάκελο και μετά κάντε κλικ στο Kutools Plus > Έγγραφο / Docx. Δείτε το στιγμιότυπο οθόνης:

2. Στο Μετατροπέας μορφής εγγράφου πλαίσιο διαλόγου, πρέπει να κάνετε τα εξής:

2.1) Επιλέξτε το φάκελο που περιέχει έγγραφα μορφής .doc στο Φάκελος αρχείου προέλευσης Ενότητα;
2.2) Επιλέξτε Μετατροπή εγγράφου σε docx από το Μετατροπή μορφής αναπτυσσόμενη λίστα;
2.3) Από προεπιλογή, το Διαδρομή προορισμού ίδια με την πηγή είναι επιλεγμένο το πλαίσιο. Εάν θέλετε να τοποθετήσετε όλα τα έγγραφα .docx που έχουν μετατραπεί στον ίδιο φάκελο, διατηρήστε αυτήν την επιλογή.
Εάν θέλετε να διαχωρίσετε τα έγγραφα .docx και τα έγγραφα προέλευσης .doc, αποεπιλέξτε το Διαδρομή προορισμού ίδια με την πηγή πλαίσιο και επιλέξτε έναν νέο φάκελο για να αποθηκεύσετε τα έγγραφα .docx στο Αποθήκευση σε κουτί;
2.4) Κάντε κλικ στο Αρχική κουμπί. Δείτε το στιγμιότυπο οθόνης:

3. Στη συνέχεια, εμφανίζεται ένα παράθυρο διαλόγου για να σας πει πόσα έγγραφα έχουν μετατραπεί επιτυχώς, κάντε κλικ στο OK κουμπί και κλείστε το Μετατροπέας μορφής εγγράφου παράθυρο.

Τώρα όλα τα έγγραφα μορφής .doc μετατρέπονται σε αρχεία .docx. Δείτε το στιγμιότυπο οθόνης:

Εάν θέλετε να δοκιμάσετε δωρεάν αυτό το βοηθητικό πρόγραμμα, μεταβείτε στη διεύθυνση δωρεάν λήψη του λογισμικού πρώτα και μετά πηγαίνετε για να εφαρμόσετε τη λειτουργία σύμφωνα με τα παραπάνω βήματα.


Τα καλύτερα εργαλεία παραγωγικότητας γραφείου

Kutools για το Outlook - Πάνω από 100 ισχυρές δυνατότητες για υπερφόρτιση του Outlook σας

🤖 Βοηθός αλληλογραφίας AI: Άμεσα επαγγελματικά email με μαγεία AI -- με ένα κλικ για ιδιοφυείς απαντήσεις, τέλειος τόνος, πολυγλωσσική γνώση. Μεταμορφώστε τα email χωρίς κόπο! ...

📧 Αυτοματοποίηση ηλεκτρονικού ταχυδρομείου: Εκτός γραφείου (Διαθέσιμο για POP και IMAP)  /  Προγραμματισμός αποστολής email  /  Αυτόματο CC/BCC βάσει κανόνων κατά την αποστολή email  /  Αυτόματη προώθηση (Σύνθετοι κανόνες)   /  Αυτόματη προσθήκη χαιρετισμού   /  Διαχωρίστε αυτόματα τα μηνύματα ηλεκτρονικού ταχυδρομείου πολλών παραληπτών σε μεμονωμένα μηνύματα ...

📨 Διαχείριση e-mail: Εύκολη ανάκληση email  /  Αποκλεισμός απάτης email από υποκείμενα και άλλους  /  Διαγραφή διπλότυπων μηνυμάτων ηλεκτρονικού ταχυδρομείου  /  Προχωρημένη Αναζήτηση  /  Ενοποίηση φακέλων ...

📁 Συνημμένα ProΜαζική αποθήκευση  /  Αποσύνδεση παρτίδας  /  Συμπίεση παρτίδας  /  Αυτόματη αποθήκευση   /  Αυτόματη απόσπαση  /  Αυτόματη συμπίεση ...

🌟 Διασύνδεση Magic: 😊Περισσότερα όμορφα και δροσερά emojis   /  Ενισχύστε την παραγωγικότητά σας στο Outlook με προβολές με καρτέλες  /  Ελαχιστοποιήστε το Outlook αντί να κλείσετε ...

???? Με ένα κλικ Wonders: Απάντηση σε όλους με εισερχόμενα συνημμένα  /   Email κατά του phishing  /  🕘Εμφάνιση ζώνης ώρας αποστολέα ...

👩🏼‍🤝‍👩🏻 Επαφές & Ημερολόγιο: Μαζική προσθήκη επαφών από επιλεγμένα μηνύματα ηλεκτρονικού ταχυδρομείου  /  Διαχωρίστε μια ομάδα επαφής σε μεμονωμένες ομάδες  /  Κατάργηση υπενθυμίσεων γενεθλίων ...

Διανεμήθηκαν παραπάνω από 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