Forum Discussion

Cal_Ab's avatar
Cal_Ab
Copper Contributor
Jul 24, 2025

Extract all lines that contain a specific string?

I have a large document, 56 pages. I need to extract a number of lines from this document. I want to extract every line that contains a specific string into a different document, or at least, put the list of lines at the end of my document. 

Is this possible with the Word 365 installed onto my computer?

4 Replies

  • Jesoxen's avatar
    Jesoxen
    Iron Contributor

    You can use the Find function, or you can extract all rows containing specific strings with a VBA script.

    • Cal_Ab's avatar
      Cal_Ab
      Copper Contributor

      Thanks... I'm trying to get a proper VBA script to do the job. I'm getting close to what I need.

  • Beth_Bujak's avatar
    Beth_Bujak
    Copper Contributor

    Have you tried using Copilot 365? It should be easy enough to ask her to extract the data.

    • Cal_Ab's avatar
      Cal_Ab
      Copper Contributor

      I didn't think of that... but I'm not a big fan of AI.

Resources