Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Delete the same text on multiple pages

Posted on 2005-04-09
7
Medium Priority
?
747 Views
Last Modified: 2012-05-05
Hi experts!!!

Every day I work with a large word documents with over 100 pages. If I want to make my job easier, I need to reduce that page number and I was able to do that by deleting  header on every page. I was doing it manualy and it's a real pain in the ass. So I wanted to ask you, is there any easier - automatic - "built in word" way to do that? I tried to use find - replace option, but all I could manage to do is to replace those unnecessary text with unnecessary empty rows (I replaced header text with "space").
Is there any "find - delete" option in word?
For those of you who don't understand what I want, here is the example...

HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT                 HEADER TEXT HEADER TEXT             HEADER TEXT         HEADER TEXT HEADER TEXT HEADER TEXT            HEADER TEXT HEADER TEXT                        HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT HEADER TEXT
(Header text is not the same in every row, it consists of many numbers, dates, spaces, ... but it is the same on every page)

NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT NEEDED TEXT

So, what I want is the way to clear HEADER TEXT from each page in the document, in order to reduce number of pages. I DON'T WANT TO REPLACE HEADER TEXT WITH BLANK ROWS since it doesn't reduce number of pages...


 THANKS!!!!
0
Comment
Question by:Da-Bu
7 Comments
 
LVL 9

Accepted Solution

by:
stengelj earned 1200 total points
ID: 13744715
I not a 100% sure what you are looking for, but let me offer this suggestion:

You mentioned find and replace did not work for you because it left the line breaks in.  Try this method again but this time do a find for "Header Text^p" and leave the replace area empty (no space).  The "^p" will include the line break between your header text and the needed text.  If there are two or more line breaks, just add additional "^p"s after the header text.

Let me know if this doesn't work and maybe you can email me a copy of the document so I can try something different.
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 13745053
You can always search and replace with nothing.
0
 
LVL 22

Assisted Solution

by:Dreamboat
Dreamboat earned 200 total points
ID: 13746283
Here's what I do.
Likely, there's some coder here who could tell you how to loop the code, but it ain't me. :)

Record a macro that does this:

Ctrl+F
Type in the first word or character in the area that you wanna delete. Make sure it's a unique string long enough so it doesn't find something you DON'T want to delete.
Then hit Find now.
Then close the find box.
Then hit your left arrow key one time. Your cursor is at the left of the text you wanna delete.
Then hit the EXT in Word's status bar.
Now Ctrl+F again.
Type the unique string that's at the END of the area you wanna remove.
Hit Find now.
Close the Find box.
Your desired text to delete should be selected.
Hit Delete.
Stop recording.

Run the macro again and again, or paste the code here and ask some poor macro coder with a great heart to write the code that'll loop it for you. Or maybe Jo knows! :)
0
Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

 
LVL 21

Expert Comment

by:Eric Fletcher
ID: 13747627
Is the header text within a table? Your description makes me think that maybe it is, and if so, Find & Replace will not work so well. If it is the only material in tables, you could use "Browse by table" option in the flyout menu from the round button at the bottom of the vertical scroll bar, then delete the found table. Here's what it might look like recorded:

Sub CutNextTableBlindly()
    Application.Browser.Target = wdBrowseTable
    Application.Browser.Next
    Selection.Tables(1).Select
    Selection.Cut
End Sub

If you assigned it to a button, it would find and cut the next table each time. If you wanted it to do the entire document, you'd need to enclose the code above in a loop.

But don't use this approach if the document has other tables within it or you'll lose all of them too.

If the tables consistently contain the header text AND are within tables, you could use Find to find the next instance of the text, then select the table and cut it -- essentially, replace the Application.Browser lines above with the recorded version of a Find with your header text as target.
0
 

Expert Comment

by:Ekaterin
ID: 13748049
Firstly - check out the special tab at the bottom of the Find-Replace dialog. If you can't see it, hit the More button.

You can enter sepcial characters into the Find What box to deal with text in rows. For example if you have

Header Text
Header Text

Then I would search for

     'Header Text^w^pHeaderText'

and replace it with nothing - a totally blank Replace with box.

To decrypt the search string the ^w adds in any amount of white space - useful if you have a couple of spaces at the end of a line which you don't know about.The ^p is a paragraph mark - telling word that the text is on two lines, and you want to get rid of both lines.

If you want to get rid of the line where the last Header Text is on, then add another ^w^p at the end of the search string, to remove the line alltogether.

Hope this helps

    Ekaterin
0
 
LVL 4

Author Comment

by:Da-Bu
ID: 13748269
Hi all!

The solution from STENGELJ was THE ONE, but I'm also giving points to DREAMBOAT for the insight in MACROS...

Thanks all!!!
0
 
LVL 22

Expert Comment

by:Dreamboat
ID: 13748306
Thanks, Da-Bu!
:)
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question