Preskoči na glavno vsebino

Kako v Wordu paketno pretvoriti datoteke formata .doc v .docx?

Recimo, da ste prejeli nekaj Wordovih dokumentov formata 97-2003, kako lahko paketno pretvorite vse te dokumente formata .doc v .docx format hkrati? Ta članek vam bo pokazal dva načina za rešitev te težave.

Datoteke v formatu .doc pretvorite v .docx s kodo VBA
Datoteke v obliki .doc v paketu pretvorite v .docx s programom Kutools for Word


Datoteke v formatu .doc pretvorite v .docx s kodo VBA

Ta razdelek vam bo prikazal kodo VBA za pretvorbo vseh dokumentov formata .doc v določeni mapi naenkrat v dokumente .docx. Naredite naslednje.

1. V določeno mapo zberite vse dokumente v obliki .doc, ki jih boste pretvorili v .docx.

2. Pritisnite druga + F11 ključ, da odprete Microsoft Visual Basic za aplikacije okno.

3. V oknu kliknite Vstavi > Moduli. Nato kopirajte spodnjo kodo VBA v okno modula.

Koda VBA: paketno pretvorite vse dokumente v obliki .doc v .docx v določeni mapi

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. Pritisnite F5 tipko za zagon kode. V uvodu Brskanje izberite mapo, ki vsebuje dokumente v obliki .doc, in kliknite OK. Oglejte si posnetek zaslona:

Nato se vsi dokumenti v .doc formatu takoj pretvorijo v dokumente .docx, kot je prikazano spodaj.


Datoteke v obliki .doc v paketu pretvorite v .docx s programom Kutools for Word

V tem poglavju bo priporočen priročen pripomoček. Z Doc / Docx uporabnost Kutools za Word, vse dokumente v obliki .doc v mapi lahko enostavno pretvorite v dokumente .docx. Poskusite, kot sledi.

Kutools za Word : Z več kot 100 priročnimi dodatki za Word, brezplačno poskusite brez omejitev 60 dni.

1. Prosimo, zberite vse dokumente v obliki .doc v določeno mapo in kliknite Kutools Plus > Doc / Docx. Oglejte si posnetek zaslona:

2. V Ljubljani Pretvornik oblike dokumenta pogovorno okno, morate storiti naslednje:

2.1) Izberite mapo, ki vsebuje dokumente formata .doc v Mapa izvorne datoteke odsek;
2.2) Izberite Pretvori dokument v docx Iz Pretvori obliko spustni seznam;
2.3) Privzeto je Ciljna pot enaka izvoru polje je označeno. Če želite vse pretvorjene .docx dokumente shraniti v isto mapo, samo izberite to možnost;
Če želite ločiti dokumente .docx in izvorne dokumente .doc, počistite polje Ciljna pot enaka izvoru in izberite novo mapo, da shranite dokumente .docx v Shrani v škatla;
2.4) Kliknite Začetek . Oglejte si posnetek zaslona:

3. Nato se prikaže pogovorno okno, ki vam pove, koliko dokumentov je bilo uspešno pretvorjenih, kliknite OK in zaprite Pretvornik oblike dokumenta okno.

Zdaj se vsi dokumenti v obliki .doc pretvorijo v datoteke .docx. Oglejte si posnetek zaslona:

Če želite brezplačno preskusiti to orodje, pojdite na brezplačno prenesete programsko opremo najprej in nato nadaljujte z uporabo postopka v skladu z zgornjimi koraki.


Najboljša pisarniška orodja za produktivnost

Kutools za Outlook - Več kot 100 zmogljivih funkcij za nadgradnjo vašega Outlooka

🤖 AI poštni pomočnik: Takojšnja profesionalna e-poštna sporočila z umetno inteligenco – z enim klikom do genialnih odgovorov, popoln ton, večjezično znanje. Preoblikujte pošiljanje e-pošte brez napora! ...

📧 Avtomatizacija e-pošte: Odsoten (na voljo za POP in IMAP)  /  Načrtujte pošiljanje e-pošte  /  Samodejna CC/BCC po pravilih pri pošiljanju e-pošte  /  Samodejno naprej (napredna pravila)   /  Samodejno dodaj pozdrav   /  E-poštna sporočila več prejemnikov samodejno razdeli na posamezna sporočila ...

📨 Email upravljanje: Enostaven priklic e-pošte  /  Blokiraj prevarantska e-poštna sporočila glede na teme in druge  /  Izbriši podvojena e-poštna sporočila  /  napredno iskanje  /  Združite mape ...

📁 Priloge ProShrani paket  /  Batch Detach  /  Paketno stiskanje  /  Samodejno shranite   /  Samodejno loči  /  Samodejno stiskanje ...

🌟 Vmesnik Magic: 😊Več lepih in kul emojijev   /  Povečajte Outlookovo produktivnost s pogledi z zavihki  /  Minimizirajte Outlook, namesto da bi ga zaprli ...

???? Čudeži z enim klikom: Odgovori vsem z dohodnimi prilogami  /   E-poštna sporočila proti lažnemu predstavljanju  /  🕘Pokaži pošiljateljev časovni pas ...

👩🏼‍🤝‍👩🏻 Stiki in koledar: Paketno dodajanje stikov iz izbranih e-poštnih sporočil  /  Razdelite skupino stikov na posamezne skupine  /  Odstranite opomnike za rojstni dan ...

Over 100 Lastnosti Čakajte na svoje raziskovanje! Kliknite tukaj, če želite odkriti več.

 

 

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