Consulting

Results 1 to 4 of 4

Thread: Find string within word document

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Mar 2022
    Posts
    8
    Location

    Find string within word document

    I have categories like:
    a, Content.
    a. Content:
    a, Content:
    I tried the following code with no success

    Sub A123()
     
        On Error Resume Next
        
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find.Replacement.Font
            .Bold = True
            .Color = wdColorBlue
        End With
        With Selection.Find
            .text = "(a[,\.] Noi dung)([.:])"
            .Replacement.text = "a) Noi dung"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchAllWordForms = False
            .MatchSoundsLike = False
            .MatchWildcards = True
    End With
        Selection.Find.Execute Replace:=wdReplaceAll
    End Sub

    Sorry my English is very bad. Thank you
    Last edited by Paul_Hossler; 05-10-2022 at 09:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •