How to remove carriage return?

  • Thread starter Thread starter Brett
  • Start date Start date
B

Brett

I've copied and pasted an article into Word 2002. Each paragraph is
seperated by an empty line. Is there a way to remove this line so that no
white space remains?

In addition, can each new paragraph be indented?

Thanks,
Brett
 
Brett,

Yes to both questions.

First you need to identify what exactly is causing the extra space. Is it
an empty paragraph, line breaks, or is it paragraph spacing.

For empty paragraphs or line breaks, you might start here:

http://www.mvps.org/word/FAQs/Formatting/CleanWebText.htm

For paragraph spacing, click Format>Paragraph, and set your before and after
paragraph spacing to suit your desires.

For the indent, use Format>Paragrpah and set indentation>special>first line.
 
Thanks. That is working 1/2 way. I indent the first line of each
paragraph. Then I replace ^p^p with ^l. That deletes all lines between
each paragraph and leaves only a carriage return at the end of each
paragraph. The problem is that my paragraphs have been deleted and that
takes out the indent first line of each paragraph. How do I work around
this?

Brett
 
I'm trying to create a macro for this technique but keep getting an invalid
procedure name. I'm using

Remove space between paragraphs and indent first line

What is wrong with the above name?

Thanks,
Brett
 
Hi, Brett,

What's wrong with the name is that macro names aren't allowed to
contain spaces, or any other character except letters, numbers, and
underscores. You can either replace each space with an underscore:

Sub Remove_space_between_paragraphs_and_indent_first_line()

or you can squeeze out all the spaces and capitalize each word:

Sub RemoveSpaceBetweenParagraphsAndIndentFirstLine()

The maximum length of a macro name is 80 characters.

To answer your question in another branch of this thread, you were
replacing the paragraph marks after setting the indents, and Word was
removing the indents. This is because all paragraph formatting --
including indents -- is stored inside the paragraph marks. You're
replacing paragraph marks that contain indents with new paragraph
marks that don't contain indents. The easiest solution is to do the
operations in the reverse order -- replace first, then indent.

A better solution is to define a paragraph style that has the indent,
plus any other spacing or other paragraph formatting you want, and
then simply apply the style to the paragraphs that should be indented.
 
Actually it doesn't :(

Use a wildcard replace of

(^13)^13{1,}
with
\1

which will replace multiple empty lines. Otherwise you would have to run
your search several times.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
What do you mean with /1? How do I enter that?

Right now, I get a prompt. I click yes and everything runs ok.

Thanks,
Brett
 
Put \1 in the replace box - exactly as written.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
Exactly as written? The word "with" doesn't work.

When I use (^13)^13{1,} or (^13)^13{\1} nothing is found.

Brett
 
In the "Find what" box, type:

(^13)^13{1,}

In the "Replace with" box, type:

\1

Is that clear enough for you?
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Brett,

What Graham is telling you is to put the \1 in the "Replace with" window.

You are using will cards in your "Find what" field.

The () used in (^13) is the wildcard that defines a group. In this case a
group containing a single parapraph mark. Word is trying to find all
instances of a single paragraph (^13) and one or more additional paragraphs
^13{1,}.

When it finds this string, it then is replacing it with the first group in
the string or \1

You don't really need to use either the ( ) or the \1

The following will work just as well:

Find what: ^13{2,}
Replace with: ^p

Graham has an excellent article on Find and Replace here:
http://www.mvps.org/word/FAQs/General/UsingWildcards.htm
 
For some reason, I get 0 replacements using your suggestion and those from
Suzanne and Graham. If I use
Find: ^p^p
Replace: ^p

It works. What might I be doing wrong?

Thanks,
Brett
 
Exactly. Thank you. Working Fine.

Brett

Greg Maxey said:
I would say you have not checked "more" "use wildcards."

--
Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
To e-mail, edit out the "w...spam" in (e-mail address removed)
 
Actually, I get the prompts in when the macro is run. For example:

Word has finished searching the selection. 42 replacements were made. Do you
want to search the remainder of the document?
<I click yes>
Same prompt
<I click yes>

Why does this occur in the macro and not when it's done manually?

Thanks,
Brett
 
Macro?

Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "(^13)^13{1,}"
.Replacement.Text = "\1"
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll


--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
Back
Top