Force "Any Character" in Replace?

E

Ed

I have documents with each line ending in a hard paragraph break (^p). I
would like to do a Find ^p&AnyCharacter / Replace With space&AnyCharacter to
remove the paragraph breaks and join the sentences back together. But the
Any Character isn't available in the Replace box. Can this be forced
through VBA? Or is there a better work-around?

Ed
 
D

Doug Robbins - Word MVP

Hi Ed,

On the assumption that the real paragraphs breaks have two¶

paragraph breaks, then the best thing is to do a replace that replaces ^p^p
with something like @@@. Then do another one that replaces ^p with a space,
and then another one that replaces @@@ with ^p^p or better replace it with
just ^p and format the paragraphs so that they have the desired space after
them to give you the separation between paragraphs that you desire.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

Hi Ed,

You could use a wildcard Edit>Replace with

(^13)([a-z]{1,})

in the Find what control and

<space>\2

in the Replace with control where for <space> you press the space bar.

See the article “Finding and replacing characters using wildcards” at:

http://www.mvps.org/word/FAQs/General/UsingWildcards.htm

to learn what that means.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 
E

Ed

Thanks for the help, Doug. I will look at that article and see if I can use
it.

Ed


Doug Robbins - Word MVP said:
Hi Ed,

You could use a wildcard Edit>Replace with

(^13)([a-z]{1,})

in the Find what control and

<space>\2

in the Replace with control where for <space> you press the space bar.

See the article "Finding and replacing characters using wildcards" at:

http://www.mvps.org/word/FAQs/General/UsingWildcards.htm

to learn what that means.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
Ed said:
Thanks, Doug. I can make that work. I was just hoping there was one of
these "known to gurus only" tricks. Actually, I would have to identify
probably three or four conditions where I woud not want to delete the
paragraph and change those, then replace the remaining paragraphs, then
reverse the previous changes. But that's why they make macros, right?

Thanks again for helping. You guys have made me look brilliant!

Ed


(^p).
I But
the
 
P

Petra Liverani

Another alternative:

I used to use the method that Doug Robbins suggests but
lately I've had documents with lots of bullet points which
means there aren't always two paragraph marks at the end
of a real paragraph and so have devised a different
method. BTW, you cannot replace Any Character but the code
^& in the Replace box will insert the contents of the Find
what box.

Assuming paragraph marks you do wish to replace with a
space are followed on the next line by a lower case letter
you can perform the task by doing two Find-and-Replaces,
the first using wildcards.

Note:
Using Wildcards the symbol for paragraph mark is ^13 and
the [a-z] will find any lower case letter in the alphabet.

Procedure

Check wildcards

In the Find box type:
^13[a-z]

In the Replace box type:
~~~^&


Uncheck wildcards

In the Find box type:
~~~^p

In the Replace box type in a space.

HTH
Petra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top