How to automatically select the content of all sections outside the code?

In an nb file, there are many input code lines and corresponding results generated by the code, as well as manually inserted images, etc. What methods do we have to automatically select all content in the file except for the code lines, so that it can be saved for other documents? If manually selecting the corresponding sections is time-consuming for large files, are there any automatic selection methods?

Evaluate the line below in you notebook and will create a new notebook with all cells except Input and Code cells.
You could put it at the end of your notebook and evaluate just this cell.
I am sure there is a better method, so this is just a quick hack.

NotebookPut[Notebook[(Map[NotebookRead])[
       With[{cd = 
      Complement[
       Union[Flatten[
         NotebookCellData[SelectedNotebook[], "CellStyle"]]], {"Code",
         "Input"}]},        
    Select[Cells[], 
     MemberQ[cd, CurrentValue[#1, "CellStyle"][[1]]] & ]]]]]

The result achieved by this code is absolutely stunning—this is exactly what we wanted. Thank you so much for your help.

After running the code, only all the sections resulting from the code execution are extracted. How can I modify it to select all other content except the code itself—such as manually entered text, inserted images, and other complete content?