Savjet: drugi jezici su prevedeni na Google. Možete posjetiti English verzija ove veze.
Prijava
x
or
x
x
Registracija
x

or

Kako pretražiti i zamijeniti više datoteka u riječi?

Ako imate nekoliko desetaka datoteka riječi koje sadrže isti sadržaj (kao što su zaglavlje, podnožje, neke posebne riječi ili broj), te morate zamijeniti isti sadržaj preko tih dokumenata u programu Word. Kako bi vam bilo lakše doći brzo? Dakako, te datoteke možete otvoriti jednu po jednu da biste zamijenili isti sadržaj, ali će vam biti dugotrajno i uznemirujuće. Ovaj vodič će vam pokazati lukav način zamjene istog sadržaja u više dokumenata u programu Word odjednom.

Pronađite i zamijenite tekstove više dokumenata u više riječi istodobno s VBA kodom


Kombinirajte / spojite više dokumenata u jedan jednostavno:

Odlomak Spoji dokumente korisnost Kutools za Word može vam pomoći da brzo kombinirate više dokumenata u jedan. Trebate samo:

  • Odaberite dokumente koje ćete kombinirati u jedan;
  • Navedite prekid između svakog kombiniranog dokumenta;
  • Započnite spajanje. Pogledajte snimak zaslona:

Kutools za Word: s više od 100 zgodnih dodataka za Word, slobodno možete pokušati bez ograničenja u 30 danima. Preuzmite i besplatno testiranje odmah!

Kutools za Word: Dodajte 100 nove napredne značajke na riječ 2003 / 2007 / 2010 / 2013 / 2016 / 2019.
Kartica sustava Office: Omogući Uređivanje i pregledavanje karata u uredu, Baš kao i Chrome, Firefox, IE 8 / 9 / 10.
Klasični izbornik za Office: Dovedite stari izgled ureda 2003 natrag na Office 2007, 2010, 2013, 2016 i 2019.

Pronađite i zamijenite tekstove više dokumenata u više riječi istodobno s VBA kodom

1. tisak drugo + F11 otvoriti Microsoft Visual Basic for Applications prozor.

2. U Microsoft Visual Basic for Applications prozor, kliknite umetak > Moduli, zatim kopirajte sljedeći VBA kod u prozor Modula.

VBA kod: Pretraživanje i zamjena istog sadržaja na više dokumenata odjednom

Sub CommandButton1_Click()
'Updated by Extendoffice 20180625
Dim xFileDialog As FileDialog, GetStr(1 To 100) As String '100 files is the maximum applying this code
Dim xFindStr As String
Dim xReplaceStr As String
Dim xDoc As Document
On Error Resume Next
Set xFileDialog = Application.FileDialog(msoFileDialogFilePicker)
With xFileDialog
    .Filters.Clear
    .Filters.Add "All WORD File ", "*.docx", 1
    .AllowMultiSelect = True
    i = 1
    If .Show = -1 Then
        For Each stiSelectedItem In .SelectedItems
            GetStr(i) = stiSelectedItem
            i = i + 1
        Next
        i = i - 1
    End If
    Application.ScreenUpdating = False
    xFindStr = InputBox("Find what:", "Kutools for Word", xFindStr)
    xReplaceStr = InputBox("Replace with:", "Kutools for Word", xReplaceStr)
    For j = 1 To i Step 1
        Set xDoc = Documents.Open(FileName:=GetStr(j), Visible:=True)
        Windows(GetStr(j)).Activate
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
            .Text = xFindStr  'Find What
            .Replacement.Text = xReplaceStr  'Replace With
            .Forward = True
            .Wrap = wdFindAsk
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchByte = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
        Selection.Find.Execute Replace:=wdReplaceAll
        Application.Run macroname:="NEWMACROS"
        ActiveDocument.Save
        ActiveWindow.Close
    Next
    Application.ScreenUpdating = True
End With
MsgBox "Operation end, please view", vbInformation
End Sub

3. pritisni F5 ključ za pokretanje koda.

4. U otvoru brstiti prozor, pronađite i odaberite dokumente koji ćete pronaći i zamijenite tekst unutar, a zatim kliknite gumb OK dugme. Pogledajte snimak zaslona:

5. U prvom Kutools za Word dijaloški okvir, unesite tekst koji ćete naći preko dokumenata u Pronađite ono što , a zatim kliknite gumb OK tipku.

6. U drugom Kutools za Word dijaloški okvir, upišite tekst koji želite zamijeniti i kliknite OK tipku.

8. Kliknite OK gumb u sljedećem Microsoft Word dijaloški okvir da biste dovršili pronalaženje i zamjenu.

U ovom slučaju, sve riječi "Riječ" u odabranim dokumentima zamjenjuju se istovremeno s "Excel".


Kartica sustava Office - Kartično pregledavanje, uređivanje i upravljanje više dokumenata u programu Word:

Kartica Office donosi kartice sučelje kao što se vidi u web preglednicima kao što su Google Chrome, Internet Explorer nove verzije i Firefox za Microsoft Word. To volja biti alat koji štedi vrijeme i nezamjenjiv je u svom radu. Pogledajte demonstraciju u nastavku:

Kliknite besplatnu probnu verziju Office Kartica!




Kutools za Word

Više od 100 naprednih funkcija za Word 2003, 2007, 2010, 2013, 2016 i 2019

shot-kutools-700-225-KTE

Dodatne mogućnosti | Besplatno preuzimanje | Samo $ 39.00 za stotine funkcija

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Muralisk · 4 years ago
    Worked like a charm and it did save a lot of time and effort for me. Thanks.
  • To post as a guest, your comment is unpublished.
    Pia Wilson · 4 years ago
    What I am trying to replace is a web address on our standard documents. I tried just doing finding the web address within the hyperlink but its not working as although this text has changed the view when not toggled to see the field code is still showing the old address.

    [b]EG[/b]
    With Selection.Find
    .Text = "HYPERLINK ""http://www.testsite.co.uk"" " 'Find What
    .Replacement.Text = "HYPERLINK ""http://www.testtwo.co.uk"" " 'Replace With
  • To post as a guest, your comment is unpublished.
    Greg Simonis · 5 years ago
    When I run it, it gets hung up and stops at:
    Application.Run macroname:="NEWMACROS"
    and when I step into it, it tells me I have a Compile error: Named argument not found.
    Now what?
  • To post as a guest, your comment is unpublished.
    Jebidiah Springfield · 5 years ago
    Wow you are a saint for putting this macro together! I am listening to 'Epic Battle Music' on Songza because I am such an amatuer Macro-smith and it's the only way I can make it through the pain and agony of crafting programming spells.

    Anyway, my point I am going to make is a spent a lot of time on Friday troubleshooting the part where you actually put in the text you want to find and putting in the text you want to replace - I did not quite understand this part in terms of where I put my "find" word text and "replace" word text:

    [quote]Note:you can change the Text = "search”, Replacement.Text = "find” to specify the content to be searched and the content to be applied for replacement.
    [/quote]

    I read over this again today and I wish to respectfully clarify for other programming non-initiates - in the section of VBA where you have copied and pasted the original programming language, make sure you put an end ' after the [i]what [/i] and a ' after the [i]with[/i] (see example below) - in my example, I am looking for multiple documents to replace Pizza with Stromboli:

    .Text = "Pizza" 'Find What'
    .Replacement.Text = "Stromboli" 'Replace With'
  • To post as a guest, your comment is unpublished.
    James R · 5 years ago
    Could this VBA technique be adapted to work for Publisher files? For example by changing *.docx to *.pub ?