Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Removing hard returns in ezines (Word 2000)

    To save paper, if I want to print a portion of an ezine/webpage, I usually copy/paste to Word and save the page until it's full (or do the Print Selection thing if it's large enough).

    Question is: Is there some way to AUTOMATICALLY take out the HARD RETURNS that ezine authors put in so that I can fill up the entire line without having to manually go in and deleting the hard return for every line over and over?

  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

    Re: Removing hard returns in ezines (Word 2000)

    There have been some discussions on this board of using the AutoFormat feature to do that, but I haven't tried it myself.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing hard returns in ezines (Word 2000)

    The following macro will take out extra carriage returns (they aren't put there by the authors--that's how plain text files copy & paste). Just select the text after pasting & run the macro. If you need instructions on where to put the macro, post back. Jefferson has a post on that somewhere.<pre>Sub EmailClean()
    '
    ' EmailClean Macro
    ' Macro created 6/12/01 by Phil Rabichow
    '
    Application.ScreenUpdating = False
    Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting

    ' Replace line break with paragraph mark
    With Selection.Find
    .Text = "^l"
    .Replacement.Text = "^p"
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ' Remove white space at the beginning of lines
    With Selection.Find
    .Text = "^p^w"
    .Replacement.Text = "^p"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ' Remove spaces before paragraph marks
    With Selection.Find
    .Text = " {1,}^013"
    .Replacement.Text = "^p"
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ' This prevents extra paragraph marks at the end of the selection
    Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend

    ' Removes spaces in first line
    With Selection.Find
    .Text = " {3,}"
    .Replacement.Text = ""
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ' Replace end of line paragraph marks with a space
    With Selection.Find
    .Text = "^p^p"
    .Replacement.Text = "%$%"
    .MatchWildcards = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' Since this causes 3 paragraph marks to have a space,
    With Selection.Find
    .Text = "^p"
    .Replacement.Text = " "
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
    .Text = "%$%"
    .Replacement.Text = "^p"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

    ' we added this to remove the space paragraph
    With Selection.Find
    .Text = "^p "
    .Replacement.Text = "^p"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' This puts 2 spaces between sentences
    With Selection.Find
    .Text = ". {1,}"
    .Replacement.Text = ". "
    .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = "? {1,}"
    .Replacement.Text = "? "
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
    .Text = "! {1,}"
    .Replacement.Text = "! "
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' we'll see how it works without this
    ' Selection.Find.ClearFormatting
    ' Selection.Find.Replacement.ClearFormatting
    ' With Selection.Find
    ' .Text = "^w^p"
    ' .Replacement.Text = "^p"
    ' .MatchWildcards = False
    ' End With
    'Selection.Find.Execute Replace:=wdReplaceAll
    ' Selection.Find.ClearFormatting
    ' Selection.Find.Replacement.ClearFormatting
    With Selection.Find
    .Text = "^p"
    .Replacement.Text = "^p^p"
    .MatchWildcards = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ' With Selection.Find
    ' .Text = " {1,}^013"
    ' .Replacement.Text = "^p"
    ' .MatchWildcards = True
    ' End With
    'Selection.Find.Execute Replace:=wdReplaceAll
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    Application.ScreenUpdating = True
    End Sub</pre>

    Cheers,

  4. #4
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing hard returns in ezines (Word 2000)

    Thank you! Just what I was looking for.

    I know how to record a macro in a document but if you could point out how to enter this macro so that it is available all the time in Word I would really appreciate it.

    Thanks again.
    Pooja

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing hard returns in ezines (Word 2000)

    Hi Pooja:
    1. Go to File/New & select "blank document".
    2. Instead of creating a blank document, click the template radio button, then OK.
    3. In the new template, press Alt+F8, to bring up the macros dialog box.
    4. Type in a macro name, such as EmailClean
    5. Click Create
    6. Paste the macro in. Depending on your browser, this should paste correctly.
    7. Save the template in your Word startup folder. On Win98SE, without user profiles, it's at
    C:WINDOWSApplication DataMicrosoftWordSTARTUP

    Cheers,

  6. #6
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing hard returns in ezines (Word 2000)

    Got it! Thanks (you just gave me a few more minutes to study everyday)

    Pooja :-)

  7. #7
    Star Lounger
    Join Date
    Jan 2001
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing hard returns -- Another Macro

    I use the attached macro. Instead of using search/replace it steps through paragraphs. It has a few advantages over the earlier posted macro. 1. Runs faster. 2. Runs against selected paragraphs or (if none selected) entire file. 3. The function IsBlank abstracts the definition of paragraph end.
    Attached Files Attached Files

  8. #8
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    210
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing hard returns -- Another Macro

    Thank you. I will use it next time I'm printing something and let you know how it worked for me.

    Pooja

Posting Permissions

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