View Single Post
  #5 (permalink)  
Old 03-22-2004, 05:13 AM
AndrewBurke
Neophyte
Join Date: Mar 2004
Posts: 1

Find the macro menu item in your version of Word and choose to record a new macro, give it a descriptive name and, for now assign it an easy to remember shortcut key (this can, of course be changed later when you decide to keep the macro). When text is pasted from an HTML screen proper paragraph code is replaced by two paragraph marks so you want to keep these; the first step is to replace these temporarily by some text that won't be wiped out by mistake.

With the macro recorder running choose Edit/Replace and choose to search the whole document. In the search field type "^P^P^P^P^P^P" (without the quotes) and in the replace field type "^P^P" and let the replace engine do it's thing. Repeat this process while still recording with 5, 4 and 3 paragraph marks in the search field and 2 in the replace. What this does is take any gap larger than two lines between text and reduce it to a proper paragraph gap. Now that we have the proper gaps established we stash them by replacing "^P^P" with "~~~" and move onto the next step which is replacing "^P" (the erroneous line breaks we want to get rid of) with a space.

This macro isn't over yet as the final phase is to replace "~~~" with "^P^P" and put back the "proper" formatting. As you can see, if we didn't use the "~~~" trick then the final search would have wiped out all the paragraph marks.

Good luck,
Andrew
 
Reply With Quote