Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find a word in a line and replace with blank line

Status
Not open for further replies.

bcdixit

Technical User
Nov 11, 2005
64
US
i want to replace a line in a word document with a blank line.

I want to replace all the lines in the document that start with a particular word with a blank line.

for example. if the document has a line that starts with the following
drop xxx
drop yyy

then I want these two line to be replaced with a blank line?

can anyone tell me how it can be done in MS word?

thanks
 
Have you tried recording a macro?

Also, you may just want to use Find and Replace, if you don't want a code solution.

This is not difficult. Although it would help to give better detail. By that I mean "line" is a funny thing in Word. It may, or it may not, mean a paragraph.

Also, by more detail, I mean if you have:

drop xxx
other text
drop yyy

Do BOTH instances of drop... get replaced by a new paragraph. Please note that I use paragraph, not "line".

Also, the fact you use the phrase "blank line" indicates to me that you are not using Styles.

If you used Styles you would never ever need any blank lines, AND it would make it much easier to remove paragraphs with whatever starting text you like.

In any case, you can do this easy enough with Find and Replace. Try it.

faq219-2884

Gerry
My paintings and sculpture
 
If the text is fixed, you could do it without a macro, using Word replace
From said:
drop xxx^pdrop yyy^p
To said:

I've done a lot of changes like that. If the text varies you might manage it with wild-cards, not something I've done.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top