Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Remove every 2nd paragraph mark (Word 2000 >)

    Hi all,

    I need assistance with a word macro. When I receive documentation from email, and I open it, it frequently has extra enter marks in the document. I would like a macro to remove these paragraph marks automatically for me. However, it must only be every second enter mark.

    This code is sample code. (I know there is no ParagraphMark object). Its just an idea of what I need!
    <pre>Sub DeletePM()
    Dim i As Integer
    For i = 1 To ParagraphMarks.Count Step 2
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    Next i
    Selection.HomeKey Unit:=wdStory
    End Sub
    </pre>

    Regards,
    Rudi

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Remove every 2nd paragraph mark (Word 2000 >)

    Rudy,

    How about using Find/Replace (don't even need to use a macro), and just find two paragraph marks (^p^p)and replace with one (^p)?

    Gary

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Remove every 2nd paragraph mark (Word 2000 >)

    Hi Gary,

    Thanx...it works great! It never even occurred to me that ^p^p would work! I was thrown off as I saw the double paragraph marks being over two lines!!

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Regards,
    Rudi

Posting Permissions

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