Բաց թողնել հիմնական բովանդակությունը

Ինչպե՞ս գտնել և փոխարինել միանգամից բազմաթիվ բառեր Word փաստաթղթում:

Word- ը տրամադրում է «Գտիր և փոխարինիր» գործառույթը `բառի կամ արտահայտության բոլոր օրինակները գտնելու և դրանք միաժամանակ նոր բառով փոխարինելու համար: Բայց եթե ուզում եք միաժամանակ գտնել և փոխարինել տարբեր բառեր, այս ներկառուցված գործառույթը չի կարող օգնել: Այս հոդվածում մենք խոսում ենք Word փաստաթղթում միանգամից մի քանի տարբեր բառեր գտնելու և փոխարինելու VBA մեթոդի մասին:

Word- ում միաժամանակ գտեք և փոխարինեք բազմաթիվ բառեր VBA կոդով
Word- ում միանգամից հեշտությամբ գտեք և փոխարինեք բազմաթիվ բառեր զարմանալի հատկությամբ


Word- ում միաժամանակ գտեք և փոխարինեք բազմաթիվ բառեր VBA կոդով

Խնդրում ենք արեք հետևյալը ՝ Word փաստաթղթում միաժամանակ գտնելու և փոխարինելու բազմաթիվ բառեր:

1. Բացեք Word փաստաթուղթը, որը ցանկանում եք գտնել և միաժամանակ փոխարինել բազմաթիվ բառեր, ապա սեղմել կոճակը ալտ + F11 բացել ստեղները Microsoft Visual Basic հավելվածների համար պատուհան.

2. Մեջ Microsoft Visual Basic հավելվածների համար պատուհանը, սեղմեք Տեղադրել > Մոդուլ. Դրանից հետո VBA կոդի ներքո պատճենեք Մոդուլի պատուհանում:

VBA կոդ. 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. Սեղմեք F5 ծածկագիրը գործելու համար:

4. Առաջինում Kutools բառի համար երկխոսության տուփ, մուտքագրեք ձեր գտած բազմաթիվ բառերը և փոխարինեք տեքստային տուփի մեջ և դրանք բաժանեք ստորակետով, ապա կտտացրեք այն OK կոճակ Տեսեք,

5. Երկրորդում Kutools բառի համար երկխոսության տուփ, մուտքագրեք նոր բառերը, որոնք դուք կփոխարինեք (այս բառերը նույնպես պետք է բաժանվեն ստորակետերով) և այնուհետև կտտացրեք այն OK կոճակը:

Նշում: Այս դեպքում բոլորը «KTE» այս փաստաթղթում կփոխարինվի «Նոր», և «KTO» և «KTW» կփոխարինվի "Փորձարկում" և «Ավարտել»: Խնդրում ենք փոխել դրանք ձեր կարիքների համար:


Word- ում միանգամից հեշտությամբ գտեք և փոխարինեք բազմաթիվ բառեր զարմանալի հատկությամբ

The Խմբաքանակի որոնում և փոխարինում առանձնահատկությունը Kutools բառի համար կարող է օգնել միանգամից գտնել և փոխարինել տարբեր տեքստեր փաստաթղթում կամ մի քանի փաստաթղթերում:

Այս գործառույթը կիրառելուց առաջ խնդրում ենք րոպեներ տրամադրել նախ ներբեռնեք և տեղադրեք այն.

1. Գործարկել Microsoft Word ծրագիրը, կտտացրեք Kutools Plus > Խմբաքանակի որոնում և փոխարինում.

2. Մեջ Խմբաքանակի որոնում և փոխարինում պատուհանը, խնդրում ենք կազմաձևել հետևյալ կերպ.

  • 2.1 կտտացրեք կոճակ> Ավելացնել Ֆայլեր or Երկապանակ ավելացնել ավելացնել մեկ կամ ավելի փաստաթղթեր, որոնցում դուք կգտնեք և կփոխարինեք բազմաթիվ բառեր:
  • 2.2 սեղմեք Ավելացնել շարասյուն դաշտերը գտնելու և փոխարինելու համար տեղադրելու կոճակը: Եթե ​​ցանկանում եք գտնել և փոխարինել միաժամանակ երեք տարբեր տեքստեր, խնդրում ենք ստեղծել երեք տող:
  • 2.3 Յուրաքանչյուր շարքում մուտքագրեք գոյություն ունեցող բառերը, որոնք դուք կփոխարինեք նոր բառերով Գտնել սյունակում, ապա մուտքագրեք նոր բառերը ՝ Փոխարինել սյունակ:
  • 2.4 Նշեք Որոնման տեսակը յուրաքանչյուր շարքի համար:
  • 2.5 Գտեք սյունակում ընտրեք, թե որտեղ կիրառել գտածոն և փոխարինել: Այն ներառում է Հիմնական փաստաթուղթ, Գլխավայր ցատկ և Google Խմբերի սկզբնական էջ այս բաժնում: Դուք կարող եք ընտրել դրանցից մեկը, երկուսը կամ բոլորը `ելնելով ձեր կարիքներից:
  • 2.6. Սեղմեք Փոխարինել գործողությունը սկսելու կոճակը: Տեսեք,

Դրանից հետո հատուկ բառերը միաժամանակ փոխարինվում են ընտրված փաստաթղթերում:

Ձեր պատասխանը ուղարկված չէ: Արդյունքը կարող եք ընդգծել ֆոնի գույնով ՝ նշելով որոշակի գույն Առաջ քաշել անընդմեջ սյունակ:

  Եթե ​​ցանկանում եք ունենալ այս օգտակար ծառայության անվճար փորձարկում (60-օրյա), խնդրում ենք կտտացնել այն ներբեռնելու համար, և այնուհետև անցեք գործողությունը կիրառելու վերը նշված քայլերին համապատասխան:

Գրասենյակի արտադրողականության լավագույն գործիքները

Kutools բառի համար - Բարձրացրեք ձեր բառի փորձը Over-ի հետ 100 Ուշագրավ առանձնահատկություններ!

🤖 Kutools AI օգնականՓոխակերպեք ձեր գրածը AI-ի միջոցով - Ստեղծեք բովանդակություն  /  Վերաշարադրել տեքստը  /  Ամփոփել փաստաթղթերը  /  Հարցրեք տեղեկատվության համար Փաստաթղթի հիման վրա, բոլորը Word-ի շրջանակներում

📘 Փաստաթղթերի տիրապետում: Էջերի բաժանում  /  Միաձուլեք փաստաթղթերը  /  Արտահանել ընտրություն տարբեր ձևաչափերով (PDF/TXT/DOC/HTML...)  /  Խմբաքանակի փոխակերպում PDF-ի  /  Արտահանել էջերը որպես պատկերներ  /  Միանգամից մի քանի ֆայլ տպեք...

Բովանդակության խմբագրում: Խմբաքանակի որոնում և փոխարինում Բազմաթիվ Ֆայլերի միջով  /  Չափափոխել բոլոր նկարները  /  Փոխադրել աղյուսակի տողերը և սյունակները  /  Աղյուսակը տեքստի վերափոխել...

🧹 Անհեշտ մաքրություն:Հեռացրու Լրացուցիչ տարածքներ  /  Բաժնի ընդմիջումներ  /  Բոլոր վերնագրերը  /  Տեքստային տուփեր  /  Hyperlinks  / Լրացուցիչ հեռացման գործիքների համար այցելեք մեր Հեռացնել խումբը...

Ստեղծագործական ներդիրներՆերդիր Հազար բաժանիչներ  /  Նշեք վանդակները  /  Ռադիո կոճակներ  /  QR Code  /  Շտրիխ կոդ  /  Անկյունագծային աղյուսակ  /  Հավասարության վերնագիր  /  Նկարի վերնագիր  /  Աղյուսակի վերնագիր  /  Բազմաթիվ նկարներ  / Բացահայտեք ավելին Տեղադրեք խումբը...

🔍 Ճշգրիտ ընտրանքներ: Մատնանշել կոնկրետ էջեր  /  սեղաններ  /  ձեւավորում  /  վերնագրի պարբերություններ  / Ընդլայնել նավարկությունը ավելին Ընտրեք հատկանիշներ...

Աստղերի բարելավումներ: Արագ նավարկեք ցանկացած վայր  /  կրկնվող տեքստի ավտոմատ տեղադրում  /  անխափան անցում փաստաթղթի պատուհանների միջև  /  11 Փոխակերպման գործիքներ...

???? Ցանկանու՞մ եք փորձել այս հնարավորությունները: Kutools-ը Word-ի համար առաջարկում է ա 60 օր անվճար դատավարություն, առանց սահմանափակումների! 🚀
 
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