MS Word not recognizing its own paragraph returns

D

dan.baechlin

Sometimes when I download text and “special paste” it into a Word
document (as unformatted unicode text), it will include a few
paragraph returns that aren’t recognized as such by Word. I designed
several macros to find and/or replace paragraph breaks, identifying
them by the Visual Basic code “^p”. But they sometimes leave a few
paragraph breaks untouched. Is there “quasi-return” code that is
displayed in Word as a paragraph mark but is in fact something else?
If so, what is the Visual Basic code that allows a macro to recognize
it?
 
M

MC

Sometimes when I download text and ³special paste² it into a Word
document (as unformatted unicode text), it will include a few
paragraph returns that aren¹t recognized as such by Word. I designed
several macros to find and/or replace paragraph breaks, identifying
them by the Visual Basic code ³^p². But they sometimes leave a few
paragraph breaks untouched. Is there ³quasi-return² code that is
displayed in Word as a paragraph mark but is in fact something else?
If so, what is the Visual Basic code that allows a macro to recognize
it?

Are you sure there isn't a space in front of the ³^p²? in other words it
could be ³ ^p² - which is hard to see.

That becomes a problem when you want to find ^p^p^p and change it to ^p^p
 
J

John McGhie

This is an artefact of some browsers.

Yes, there *is* a "funny-thing" code that will upset your apple-cart.

On a Unix system, records and lines of text are delimited by a "New Line"
character, code 0A (hex) or 42 (decimal).

On a PC, by a Carriage Return + New Line combination (0D, 0A).

Just to annoy us, some web authors insist on attempting to control their
line lengths by inserting a Break Character, which most browsers will render
as a single Carriage Return.

Word will interpret any two break characters as a new paragraph, and any
single break character as a "new line". Sometimes you will see web text
that consists entirely of "new lines" and in Word the whole thing pastes as
a large single paragraph with line breaks at the end of each line.

Since a line break is a "character", not a "container object" in Word, it
cannot contain any formatting.

If you think this has happened, you can turn on your paragraph marks and
look closely: the Break shows as a ? character, the paragraph as a ¢Ò
character.

Either way, you have to Find/Replace all the "Manual Line Breaks" (^m) with
paragraph marks (^p). Then your code will work.

Cheers


Sometimes when I download text and ¡°special paste¡± it into a Word
document (as unformatted unicode text), it will include a few
paragraph returns that aren¡¯t recognized as such by Word. I designed
several macros to find and/or replace paragraph breaks, identifying
them by the Visual Basic code ¡°^p¡±. But they sometimes leave a few
paragraph breaks untouched. Is there ¡°quasi-return¡± code that is
displayed in Word as a paragraph mark but is in fact something else?
If so, what is the Visual Basic code that allows a macro to recognize
it?

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Microsoft MVP, Word and Word:Mac
Sydney, Australia. mailto:[email protected]
 

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