Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Hi -

    This macro from Word 2002 doesn't seem to work in 2003???

    Sub ParaNoSpaceBtw()
    With Selection.ParagraphFormat
    .SpaceBefore = 0
    .SpaceBeforeAuto = False
    .SpaceAfter = 0
    .SpaceAfterAuto = False
    End With
    End Sub

    Any hints to get this working most welcomed. Thanks!

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by uncle View Post
    This macro from Word 2002 doesn't seem to work in 2003???
    What do you mean by it doesn't work: the settings are not changed, or the settings do not behave as expected? If you get a specific error, please let us know.

    If you select one of the problem paragraphs, can you tell whether it might have Spacing After set?

    Also, each version of Word has a growing list of compatibility options, and some of these affect the spacing between paragraphs. You can view and toggle these settings under Tools > Options..., Compatibility tab.

    Does any of that help?

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi Uncle,

    Why are you using this macro instead of using a properly-defined paragraph Style?
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #4
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Morning, and thanks for your replies.

    I use the macro because I do a lot of copy/paste operations.

    What I am looking for is to eliminate the paragraph between, for instance, these 2 lines so I get, after selecting the lines and running the macro:

    Now is the time for all good men

    To come to aid of

    Now is the time for all good men
    To come to aid of

    Thank you.

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Quote Originally Posted by uncle View Post
    Morning, and thanks for your replies.

    I use the macro because I do a lot of copy/paste operations.

    What I am looking for is to eliminate the paragraph between, for instance, these 2 lines ...
    Hi Uncle,

    Your macro doesn't actually do that - all it does is to change the paragraph before/after formatting, but you still end up with a separate paragraph for each line.

    If you really want to join the lines into a single logical paragraph, but retaining the current line breaks, use Find/Replace with:
    Find = ^p
    Replace = ^l
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Thank you.

  7. #7
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Sorry to be a pest about this, but when I use that Find/Replace I get a rectangular box after the word 'time' in first line. I tried to copy that line here to show the box, but only the text got pasted, not the box. The box appeared when I changed fonts to see if the font were the cause....

    Uncle

  8. #8
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi Uncle,

    It may be that whatever font you're using renders the manual line break this way on screen. Some do that if the character isn't defined in their character set. You should still get the line break, however, and the 'box' shouldn't print. If that's not the case, can you post a copy of the problem document - with just the errant portion from before you did the Find/Replace?
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  9. #9
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Thank you for your quick response.

    Here is the attachment of the 2 lines. Of course, if I can get this going I would use it one more than 2 lines in a document....

    Edited: sorry, having problem attaching. Will send again. 'Cannot see Add to Post' link

  10. #10
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Sorry, for some reason "upload file" didn't work a few moments ago...
    Attached Files Attached Files

  11. #11
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi uncle,

    Your attached document appears to contain only a screen dump of another document. What I need is a copy of the actual document you're having problems with - there's nothing in a image of it that I can test.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  12. #12
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Sorry. Here is a document....
    Attached Files Attached Files

  13. #13
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Hi uncle,

    OK, what your document has is lines separated by empty paragraphs. This is readily apparent if you have Word configured to show the formatting marks.

    So, in the document you posted, you have:
    Now is the time for allÂ
    Â
    Good men to come to the aid ofÂ
    (I've inserted the ASCII symbols here that replicate the paragraph marks in the document)

    What you need to do, then, is to delete the empty paragraphs as part of the process I described earlier.

    You can do this with a wildcard Find/Replace, where:
    Find = [^13]{1,}
    Replace = ^l
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  14. #14
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Chichester, UK
    Posts
    401
    Thanks
    1
    Thanked 10 Times in 9 Posts
    Quote Originally Posted by uncle View Post
    Sorry. Here is a document....
    What you need to do is to use Find to search for double paragraph marks and replace with a single paragraph mar.

    So use Crtl+H and in the find box type ^p^p and in the replace box type ^p

    That will effectively remove the extra spaces.

  15. #15
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    If you really want a quick method of changing the before spacing before each para, try the Ctrl + 0 plus shortcut. This is a toggle, adding and removing an extra space in front of each paragraph.

    I know - the question really was about extra hard returns.
    I just needed to feel useful.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Page 1 of 2 12 LastLast

Posting Permissions

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