Tip: Mae ieithoedd eraill yn Google-Cyfieithu. Gallwch ymweld â'r English fersiwn o'r ddolen hon.
Mewngofnodi
x
or
x
x
cofrestr
x

or

Sut i chwilio a disodli ar draws sawl ffeil mewn gair?

Os oes gennych chi sawl dwsin o ffeiliau geiriau sy'n cynnwys yr un cynnwys (fel Pennawd, troednod, rhai geiriau neu rif arbennig), a bydd angen i chi ddisodli'r un cynnwys ar draws y dogfennau hynny yn Word. Sut fyddai hi'n haws i chi ei wneud yn gyflym? Yn sicr, gallwch chi agor y ffeiliau hynny fesul un i ailosod yr un cynnwys, ond bydd yn cymryd llawer o amser ac yn drafferthus. Bydd y tiwtorial hwn yn dangos ffordd anodd arnoch i ddisodli'r un cynnwys mewn dogfennau lluosog yn Word ar unwaith.

Darganfyddwch a disodli testunau ar draws dogfennau geiriau lluosog ar yr un pryd â chod VBA


Cyfuno / uno sawl dogfen yn hawdd:

y Cyfuno Dogfennau cyfleustodau i Kutools ar gyfer Word Gall eich helpu i gyfuno sawl dogfen i mewn i un yn gyflym. Dim ond angen i chi:

  • Dewiswch y dogfennau y byddwch chi'n eu cyfuno i mewn i un;
  • Nodwch yr egwyl rhwng pob dogfen gyfunol;
  • Dechreuwch uno. Gweler y sgrin:

Kutools ar gyfer Word: gyda mwy na 100 Word hand add-ins, yn rhad ac am ddim i geisio heb gyfyngiad yn 30 diwrnod. Lawrlwythwch a threial am ddim Nawr!

Kutools ar gyfer Word: Ychwanegu 100 Nodweddion Uwch Newydd i Word 2003 / 2007 / 2010 / 2013 / 2016 / 2019.
Tab Swyddfa: Galluogi Golygu a Pori Tabbed yn y Swyddfa, Just Like Chrome, Firefox, IE 8 / 9 / 10.
Bwydlen Clasurol ar gyfer Swyddfa: Dewch â Hen Edrych Swyddfa 2003 Yn ôl i Office 2007, 2010, 2013, 2016 a 2019.

Darganfyddwch a disodli testunau ar draws dogfennau geiriau lluosog ar yr un pryd â chod VBA

1. Gwasgwch Alt + F11 i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yn y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr, cliciwch Mewnosod > Modiwlau, yna copïwch y cod VBA canlynol i mewn i ffenestr y Modiwl.

Cod VBA: Chwilio a disodli'r un cynnwys ar draws sawl dogfen ar yr un pryd

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. Gwasgwch y F5 allweddol i redeg y cod.

4. Yn yr agoriad Pori ffenestr, darganfyddwch a dewiswch y dogfennau y byddwch yn eu canfod ac yn disodli'r testun y tu mewn, ac wedyn cliciwch OK botwm. Gweler y sgrin:

5. Yn y cyntaf Kutools ar gyfer Word blwch deialog, nodwch y testun y byddwch yn ei chael ar draws dogfennau yn y Dod o hyd i beth blwch, ac yna cliciwch ar OK botwm.

6. Yn yr ail Kutools ar gyfer Word blwch deialog, nodwch y testun y byddwch yn ei ddisodli, a chliciwch ar y OK botwm.

8. Cliciwch ar y OK botwm yn y nesaf Microsoft Word blwch deialog i orffen darganfod a disodli.

Yn yr achos hwn, caiff yr holl eiriau "Word" mewn dogfennau dethol eu disodli gan "Excel" ar yr un pryd.


Tab Swyddfa - Pori, Golygu, Gosod Tabbed a Rheoli Dogfennau lluosog mewn Word:

Mae Office Tab yn dod â'r rhyngwyneb tabbed fel y gwelir mewn porwyr gwe fel Google Chrome, fersiynau newydd Internet Explorer a Firefox i Microsoft Word. Mae'n Bydd bod yn offeryn achub amser ac yn anorfodadwy yn eich gwaith. Gweler y demo isod:

Cliciwch ar gyfer treialu Tab Tab Office am ddim!




Kutools ar gyfer Word

Mwy na Swyddogaethau Uwch 100 ar gyfer Word 2003, 2007, 2010, 2013, 2016 a 2019

shot-kutools-700-225-kte

Mwy o Nodweddion | Lawrlwythiad Am Ddim | $ 39.00 yn unig ar gyfer cannoedd o swyddogaethau

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.
    Tiago · 26 days ago
    Is it possible to replace in the headers of the word doc?
    • To post as a guest, your comment is unpublished.
      crystal · 22 days ago
      Hi Tiago,
      Please apply the below VBA code to include the content of headers and footers when finding and replacing texts in multiple documents at once.

      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"
      If MsgBox("Do you want to replace texts in headers and footers too? ", vbYesNo, "Kutools for Word") = vbYes Then
      ActiveWindow.View.SplitSpecial = wdPanePrimaryFooter
      Selection.Find.Execute Replace:=wdReplaceAll
      Application.Run macroname:="NEWMACROS"
      ActiveWindow.View.SplitSpecial = wdPanePrimaryHeader
      Selection.Find.Execute Replace:=wdReplaceAll
      Application.Run macroname:="NEWMACROS"
      End If
      ActiveDocument.Save
      ActiveWindow.Close
      Next
      Application.ScreenUpdating = True
      End With
      MsgBox "Operation end, please view", vbInformation
      End Sub
  • To post as a guest, your comment is unpublished.
    dsadasd · 26 days ago
    Is that possible to replace in the header of the word doc?
  • To post as a guest, your comment is unpublished.
    martinadam · 3 months ago
    Thanks for sharing this information with us.
    Word search and replace tool
  • To post as a guest, your comment is unpublished.
    nathalie · 5 months ago
    Works perfectly but is there a similar macro to change text in the header! because this does not work with this version!
    thanks
    • To post as a guest, your comment is unpublished.
      crystal · 22 days ago
      Hi,
      Please apply the below VBA code to include the content of headers and footers when finding and replacing texts in multiple documents at once.

      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"
      If MsgBox("Do you want to replace texts in headers and footers too? ", vbYesNo, "Kutools for Word") = vbYes Then
      ActiveWindow.View.SplitSpecial = wdPanePrimaryFooter
      Selection.Find.Execute Replace:=wdReplaceAll
      Application.Run macroname:="NEWMACROS"
      ActiveWindow.View.SplitSpecial = wdPanePrimaryHeader
      Selection.Find.Execute Replace:=wdReplaceAll
      Application.Run macroname:="NEWMACROS"
      End If
      ActiveDocument.Save
      ActiveWindow.Close
      Next
      Application.ScreenUpdating = True
      End With
      MsgBox "Operation end, please view", vbInformation
      End Sub
  • To post as a guest, your comment is unpublished.
    blds · 1 years ago
    Doesn't work for me on footers. e.g find FFSOSxxxx and replace with GGSOSxxxx, i can see this code is great for others pls help. :(