Results 1 to 3 of 3

Thread: Search an expression (code) and turn the whole line into heading

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Hello, you can try this code: geometry dash scratch
    Sub head6_to_heading()
        Dim doc As Word.Document
        Dim rng As Word.Range
        Set doc = ActiveDocument
        Set rng = doc.Content
        With rng.Find
            .Text = "(head-"
            .MatchCase = False
            .MatchWholeWord = False
            .Wrap = wdFindStop
            Do While .Execute
                rng.Paragraphs(1).Range.Style = doc.Styles("Heading 6")
            Loop
        End With
    End Sub
    Last edited by ruthburks; 02-04-2024 at 06:02 PM.

Tags for this Thread

Posting Permissions

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