Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting a document (word97)

    Hi,
    I have just been requested to provide a macro for formatting a document that is created by Crystal Reports. the problem being that there are extra line spacings (carriage returns) in the document that need to be removed. Something like this:
    Section Title

    Paragraph Title

    text

    text

    text
    text
    Paragraph Title

    text

    text

    Section Title
    and so on

    but i want it to be ...
    Section Title

    Paragraph Title
    text
    text
    text
    text

    Paragraph Title
    text
    text

    Section Title
    ....

    how can i move through the document looking for the section/paragraph/text lines and remove the unwanted (empty) line ?

    Any suggestions gratefully received ! <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting a document (word97)

    Turn your show/hide button on--it's the backwards P icon on your top toolbar.
    Hit ctrl-h (find/replace). In Find what, type:

    ^p^p (two paragraph returns)

    In Replace with, type:

    ^p

    Hit replace all. Keep hitting it until zero replacements are made.

    Consider, too, that (as far as I know) Crystal reports can export to Excel and it might be easier to delete the empty rows. You can select column A, hit Edit-Go to-Special-Blanks, then hit Edit-Delete. You'll be asked if you want to shift cells, etc. You'll choose "delete entire row". You can then easily copy this into Word. It will be a table. If you don't want the table, you just click inside the table, hit Table-Select table. Hit Table-Convert table to text.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting a document (word97)

    This looks good, i have tried excel and had to try word as some of the content is > 255 characters and excel truncates it !

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •