Skip to main content

Conas iliomad focal a aimsiú agus a athsholáthar ag an am céanna i ndoiciméad Word?

Soláthraíonn Word feidhm Aimsigh agus Ionadaigh chun gach cás focal nó frása a aimsiú agus focal nua a chur ina áit ag an am céanna. Ach más mian leat focail éagsúla a aimsiú agus a athsholáthar ag an am céanna, ní féidir leis an bhfeidhm ionsuite seo cabhrú leat. San Airteagal seo, táimid ag caint faoi mhodh VBA chun iliomad focal éagsúil a aimsiú agus a athsholáthar ag an am céanna i ndoiciméad Word.

Faigh agus cuir cód VBA in ionad focail iolracha ag an am céanna i Word
Gné iontach a aimsiú agus a athsholáthar go héasca ag an am céanna i Word


Faigh agus cuir cód VBA in ionad focail iolracha ag an am céanna i Word

Déan mar a leanas le do thoil chun iliomad focal a fháil agus a athsholáthar ag an am céanna i ndoiciméad Word.

1. Oscail an doiciméad Word is mian leat a fháil agus cuir focail iolracha ina áit ag an am céanna, ansin brúigh an Eile + F11 eochracha a oscailt Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. Sa Microsoft Visual Basic d’Fheidhmchláir fuinneog, cliceáil Ionsáigh > Modúl. Ansin cóipeáil thíos cód VBA isteach i bhfuinneog an Mhodúil.

Cód VBA: Faigh agus cuir focail iolracha ag an am céanna i Word

Sub FindAndReplaceMultiItems()
'Update by ExtendOffice 2018/10/25
    Dim xFind As String
    Dim xReplace As String
    Dim xFindArr, xReplaceArr
    Dim I As Long
    Application.ScreenUpdating = False
    xFind = InputBox("Enter items to be found here,seperated by comma: ", "Kutools for Word")
    xReplace = InputBox("Enter new items here, seperated by comma: ", "Kutools for Word")
    xFindArr = Split(xFind, ",")
    xReplaceArr = Split(xReplace, ",")
    If UBound(xFindArr) <> UBound(xReplaceArr) Then
        MsgBox "Find and replace characters must be equal.", vbInformation, "Kutools for Word"
        Exit Sub
    End If
    For I = 0 To UBound(xFindArr)
        Selection.HomeKey Unit:=wdStory
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = xFindArr(I)
            .Replacement.Text = xReplaceArr(I)
            .Format = False
            .MatchWholeWord = False
        End With
        Selection.Find.Execute Replace:=wdReplaceAll
    Next
    Application.ScreenUpdating = True
End Sub

3. Brúigh an F5 eochair chun an cód a rith.

4. Sa chéad cheann Kutools le haghaidh Word bosca dialóige, iontráil na focail iolracha a gheobhaidh tú agus cuir isteach sa bhosca téacs iad, agus cuir camóg orthu, ansin cliceáil ar an OK cnaipe. Féach an pictiúr:

5. Sa dara ceann Kutools le haghaidh Word bosca dialóige, iontráil na focail nua a chuirfidh tú ina n-ionad (ní mór camóga a scaradh ó na focail seo freisin), agus ansin cliceáil ar an OK cnaipe.

Nóta: Sa chás seo, go léir “KTE” cuirfear in ionad an doiciméid seo “Nua”, agus “KTO” agus "KTW" cuirfear in ionad "Scrúdú" agus “Críochnaigh”. Athraigh iad le do chuid riachtanas le do thoil.


Gné iontach a aimsiú agus a athsholáthar go héasca ag an am céanna i Word

An Faigh Baisc agus Ionadaigh gné de Kutools le haghaidh Word is féidir leis cabhrú le téacsanna éagsúla a aimsiú agus a athsholáthar go héasca i ndoiciméad nó ar fud iliomad doiciméad ag an am céanna.

Sula gcuirfidh tú an ghné seo i bhfeidhm, glac miontuairiscí le do thoil é a íoslódáil agus a shuiteáil ar dtús.

1. Seoladh an feidhmchlár Microsoft Word, cliceáil Kutools Plus > Faigh Baisc agus Ionadaigh.

2. Sa Faigh Baisc agus Ionadaigh fhuinneog, cumraigh mar a leanas le do thoil.

  • 2.1 cliceáil ar an cnaipe> Cuir Comhad leis or Cuir Fillteán Leis chun doiciméad amháin nó níos mó a chur leis ina bhfaighidh tú iliomad focal agus ina n-ionad.
  • 2.2 Cliceáil ar an Cuir as a chéile cnaipe chun na réimsí aimsithe agus athsholáthair a chur isteach. Más mian leat trí théacs éagsúla a aimsiú agus a athsholáthar ag an am céanna, cruthaigh trí shraith le do thoil.
  • 2.3 I ngach sraith, iontráil na focail atá ann cheana agus cuirfear ceann nua ina áit Aimsigh colún, agus ansin cuir na focail nua isteach sa Ionadaigh colún.
  • 2.4 Sonraigh an Cineál Cuardaigh do gach ró.
  • 2.5 Sa Faigh isteach colún, roghnaigh cá háit a ndéanfaidh tú an fhionnachtain agus a athsholáthar. Cuimsíonn sé Príomhdhoiciméad, ceanntásc agus Buntásc san alt seo. Is féidir leat ceann acu a roghnú, beirt acu nó iad go léir bunaithe ar do chuid riachtanas.
  • 2.6. Cliceáil ar an Ionadaigh cnaipe chun an oibríocht a thosú. Féach an pictiúr:

Ansin cuirtear na focail shonracha in ionad i ndoiciméid roghnaithe ag an am céanna.

Leid: Is féidir leat an toradh a aibhsiú le dath cúlra trí dhath áirithe a shonrú sa Aibhsigh colún as a chéile.

  Más mian leat triail saor in aisce (60 lá) a bheith agat ar an bhfóntas seo, cliceáil le do thoil chun é a íoslódáil, agus ansin téigh chun an oibríocht a chur i bhfeidhm de réir na gcéimeanna thuas.

Uirlisí Táirgiúlachta Oifige is Fearr

Kutools le haghaidh Word - Elevate Your Word Experience with Over 100 Gnéithe Suntasacha!

🤖 Cúntóir Kutools AI: athraigh do chuid scríbhinn le AI - Gin Ábhar  /  Athscríobh Téacs  /  Déan achoimre ar Dhoiciméid  /  Fiosraigh le haghaidh Faisnéise bunaithe ar Doiciméad, ar fad laistigh de Word

📘 Máistreacht Doiciméad: Leathanaigh Scoilte  /  Cumaisc Doiciméid  /  Roghnú Easpórtála i bhFormáidí Éagsúla (PDF/TXT/DOC/HTML...)  /  Baisc a thiontú go PDF  /  Easpórtáil Leathanaigh mar Íomhánna  /  Priontáil Comhaid Il ag an am céanna...

Eagarthóireacht na nÁbhar: Faigh Baisc agus Ionadaigh thar Chomhaid Il  /  Athraigh Méid Gach Pictiúr  /  Trasnaigh Rónna Tábla agus Colúin  /  Tiontaigh Tábla go Téacs...

🧹 Effortless Glan: Sguab as Spásanna Breise  /  Sosanna Alt  /  Gach Ceanntásca  /  Boscaí Téacs  /  Hipearnasc  / Le haghaidh tuilleadh uirlisí a bhaint, ceann chuig ár Bain Grúpa...

Ionsáigh Cruthaitheach: cuir isteach Míle Deighilteoir  /  Boscaí Seiceála  /  Cnaipí Raidió  /  Cód QR  /  barcode  /  Tábla Líne Trasnánach  /  Fotheideal Cothromóid  /  Fotheideal Íomhá  /  Fotheideal Tábla  /  Pictiúir Il  / Faigh amach níos mó sa Cuir isteach Grúpa...

🔍 Roghanna Beachtais: Pionta leathanaigh ar leith  /  táblaí  /  cruthanna  /  míreanna ceannteideal  / Feabhsaigh an loingseoireacht le níos mó Roghnaigh gnéithe...

Feabhsuithe Réalta: Déan nascleanúint go tapa chuig aon láthair  /  cuir isteach téacs athchleachtach go huathoibríoch  /  scoránaigh gan uaim idir fuinneoga doiciméad  /  11 Uirlisí Tiontaithe...

???? Ar mhaith leat triail a bhaint as na gnéithe seo? Kutools le haghaidh Word cuireann a Triail saor in aisce 60 lá, gan teorainneacha! 🚀
 
Comments (23)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
The VBA script you provide here seems to work only for Latin characters; is there some workaround to get special characters to work.
I work with Sanskrit, which used the Devanagari script, similar to Hindi. (1) The VBA does not accept the Devanagai font nor does it find the Latin characters with diacriticals. For example: It fails miserably if I search for mūlādhāra (मूलाधार). It doesn't seem to recognize the ū or ā, for example, and the Devanagari is a complete loss.

Moreover, does the script recognize spaces between words? If not, how do I get them in there?

Thank you!
This comment was minimized by the moderator on the site
Chào bạn, có cách nào thay thế RẤT NHIỀU cụm từ bằng RẤT NHIỀU cụm từ khác (nhập từng cụm từ rất mất thời gian) bằng cách m lập một file trong đó có 2 cột, 1 cột là cụm từ nguồn và cột 2 là cụm từ đích được không? rất cám ơn bạn.
This comment was minimized by the moderator on the site
Hi Nguyễn Phúc Lâm,
I recommand you apply the Batch Find and Replace feature of Kutools for Word (the second method in this post) to solve this problem.
In the Find and Replace dialog box, after creating the two columns you need, you can save the current settings as a scenaria for future use.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/find_and_replace.png
This comment was minimized by the moderator on the site
Cám ơn Crystal, cách này có thể áp dụng với một số lượng nhỏ các cụm từ, nếu với số lượng các cụm từ lớn (hơn 1000, hơn 10000.. cụm từ) thì rất khó để có thể nhập thủ công. Vậy có cách nào khác không bạn? Cám ơn bạn đã trả lời
This comment was minimized by the moderator on the site
Hi Nguyễn Phúc Lâm,
Temporarily unable to deal with this problem with VBA code as it is a bit complex. This feature will be considered for upgrade in the next release. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Thanks for the project, Could you make it the way we can also replace letters in words. For example if i want to change Dollar as DoLLar it does not function.
This comment was minimized by the moderator on the site
In the first instruction (Find And Replace Multiple Words At The Same Time In Word With VBA Code), it does not find instances where the word to be replaced falls in the middle of a word (For example, .com following a website name). Can this be modified to do so?
This comment was minimized by the moderator on the site
What if I'm trying to replace commas?
This comment was minimized by the moderator on the site
The VBA code can't help to replace commas. You can apply Kutools to achieve.
This comment was minimized by the moderator on the site
After hitting Replace it just goes to Preview and doesn't do anything further.
This comment was minimized by the moderator on the site
Hi Ajs,All required words have been successfully replaced at once after hitting the Replace button. It goes to the Preview tab to help you know how many words have been successfully replaced. After that, close the dialog box.
This comment was minimized by the moderator on the site
Hi! First, congratulations for your work: this macro is very useful and interesting! I would like, neverthless, you help me with one thing. I am a proofreader and would like the replacements would highlithed in green or red color. How can I do this? Is there a code line I could use?
This comment was minimized by the moderator on the site
Hi, The Batch Find and Replace feature of Kutools for Word can perfectly solve your problem, you can have a try.
This comment was minimized by the moderator on the site
Hi how can this macro be revised to take more key words? I have about 170 words that I wold like to find and replace
This comment was minimized by the moderator on the site
Hi JM,
After running the code, a Kutools for Excel dialog box will pop up, please enter the keywords you will find and separate them with commas.
This comment was minimized by the moderator on the site
How to find and select multiple words at the same time
This comment was minimized by the moderator on the site
Hi,
After running the code, a Kutools for Excel dialog box will pop up, please enter the keywords you will find and separate them with commas.
This comment was minimized by the moderator on the site
Hi, This works well with English Words. Now I am doing a document where I translate English to Gujarati. So, when I apply this, (Find English Words) and (Replace with Gujarati words), it does change but it appears like "???". Doesn't show the Gujarati word but just question marks? Any further help? Please.
This comment was minimized by the moderator on the site
I'm have a similar problem with Sanskrit, not only the Devanagari script but also the English/Latin diacriticals on the special characters like ā, ū, ṛ, ṁ, ṃ, etc. Any suggestions for a workable fix?
This comment was minimized by the moderator on the site
Hello Shailesh, facing the same issue. Did you find a solution to it. Am also trying to figure out how to change from Chinese to English.
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