View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Need Macro to remove empty paragraph marks.

Hi ISay,

You can use the Find/Replace codes I posted on the whole document (or however much of it you still need to process) at once -
there's no need to process each paragraph individually.

I suggest using a 5-step process:
First, make sure there are two paragraph marks (either '^13' or '^p', it doesn't matter) between the 'real' paragraphs.
The next 4 steps are done sequentially and consist of replacing all instances of :
.. '^13' with '^p'
.. '^p^p' with '!~!'
.. '^p' with ' '
.. '!~!' with '^p' (or '^p^p' if you want to retain two paragraph marks between the 'real' paragraphs).
If you really want to use a macro, record one with the macro recorder - it's fairly efficient in this case. However, it'll take
longer to record than to go through the last 4 steps! And it won't help with ensuring the required initial separation between the
'real' paragraphs.

--
Cheers
macropod
[MVP - Microsoft Word]


"ISay" wrote in message ...
This works up to a point. I'm still left with a paragraph mark/carriage
return at the end of every line so that I cannot justify the text. I can
highlight each paragraph then run a replace to remove paragraph marks within
that paragraph which is more trouble than it is worth. I need a macro for
doing this.

I would also like to know how to create a loop within a macro to continue to
the end of the document.


"macropod" wrote:

Hi ISay,

Ordinarily, Word expects a paragraph mark to consist of two characters - Hex OD & OA (ASCII 13 & 10). These constitute a carriage
return and line-feed pair. Sometimes, only the carriage return may be presnt, but Word will still display it as 'ΒΆ'.

All you need to do to overcome this is to use '^13' in the 'Find' box and, if you want to replace it with a 'proper' paragraph
marker, '^p' in the 'Replace' box.

--
Cheers
macropod
[MVP - Microsoft Word]