Skip to main content

Conas a trom gach cás den chéanna word i Word doiciméad?

Má tá iolraí "outlook” téacsanna i do Word comhad, anois ní mór duit na "outlook” téacsanna chomh trom. Cén chaoi a bhféadfá trom a chur ar gach cás den chéanna word i mór Word doiciméad chomh tapa agus is féidir?

Trom gach cás den chéanna word i Word doiciméad le cód VBA


Trom gach cás den chéanna word i Word doiciméad le cód VBA

Is féidir leis an gcód VBA seo a leanas cabhrú leat cló trom a chur ar gach cás de shainiúil word tapa agus go héasca, déan mar seo le do thoil:

1. Coinnigh síos an ALT + F11 eochracha a oscailt Microsoft Visual Basic d’Fheidhmchláir fhuinneog.

2. Agus ansin, cliceáil Ionsáigh > Modúil, cóipeáil agus greamaigh an cód thíos sa mhodúl bán oscailte:

Cód VBA: Trom gach cás den chéanna word

Sub BoldAll()
    Dim xStr As String
    xStr = InputBox("Please enter the word that you want to bold:", "KuTools for Word")
    If Trim(xStr) = "" Then
        MsgBox "Cann’t be empty!", vbInformation, "KuTools for Word"
    End If
    With ActiveDocument.Content.Find
        .ClearFormatting
        .Text = xStr
        .Replacement.ClearFormatting
        .Replacement.Font.Bold = True
        .Replacement.Text = "^&"
        .Wrap = wdFindStop
        .Format = True
        .Forward = True
        .Execute Replace:=wdReplaceAll
    End With
End Sub

3. Tar éis duit an cód a chur isteach, agus ansin brúigh F5 eochair chun é a rith, agus tá bosca dialóige popped amach a chur i gcuimhne duit a chur isteach an word gur mhaith leat cló trom a dhéanamh, féach an scáileán scáileáin:

doc trom sonrach word 1

4. Agus ansin, cliceáil OK cnaipe, agus go léir ar leith words formáidithe i gcló trom láithreach.


molta Word Uirlisí Táirgiúlachta

 

Kutools For Word - Níos mó ná 100 Ardghnéithe Do Word, Sábháil Do Am 50%.

  • Is féidir oibríochtaí casta agus arís agus arís eile a dhéanamh próiseáil aon-uaire i soicindí.
  • Cuir isteach íomhánna iolracha trasna fillteáin isteach Word doiciméad láithreach.
  • Cumaisc agus cuir le chéile iolrach Word comhaid trasna fillteáin isteach i gceann le d'ordú inmhianaithe.
  • Roinn an doiciméad reatha i ndoiciméid ar leithligh de réir ceannteidil, briseadh ailt nó critéir eile.
  • Tiontaigh comhaid idir Doc agus Docx, Docx agus PDF, bailiú uirlisí le haghaidh comhshó agus roghnú coitianta, agus mar sin de ...
Comments (3)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Using Google Translate, this is what Stef had said,
"Hello and thank you for this piece of VBA code.

I work on documents that contain keywords explained like this <#myKeyword>
I would like to identify and bold all the elements that are between < and >.

Is this possible in VBA and could you guide me?

Best to you. (A friendly regard used between people who exchange services or information.)

Stef"

Separately, I, Kaitlyn, was wondering if I could use code to bold all questions.
This comment was minimized by the moderator on the site
Bonjour et merci pour ce bout de code VBA.

Je travaille sur des documents qui contiennent des mots clés explicités de la sorte <#monMotClé>
je souhaiterais repérer et mettre en gras tous les éléments qui se trouvent entre < et >.

est-ce que cela est possible en VBA et pourriez vous me guider ?

Bien à vous.

Stef
This comment was minimized by the moderator on the site
Hello, Stef,
Sorry, I can't understand your question clearly, could you explain your problem in English?
Thank you!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations