Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    I have two paragraphs, each with 3 sentences. Starting at the beginning of the last sentence of para 1, I select text to the end of the first sentence of para 2. I hit Delete. The text is deleted, but the paragraph mark remains. I still have two paragraphs, each with two sentences. I want on paragraph with four sentence.

    I'm wondering why Word leaves the unwanted paragraph mark? If I select from just in front of the paragraph mark of para 1, through to the end of the first sentence of para 2, Delete does delete the unwanted paragraph mark.

    If I were to select through to a 3rd para, and delete, Word leaves me with only one unwanted paragraph mark, not two.

    I'm wondering if there is a reason for this seemingly inconsistent behavior.

    I discovered this as I wrote VBA code to delete text of a bookmark range, which spanned two paragraphs. To get around this, I used Replace to change the paragraph mark to a space, and then deleted the range. Problem solved, but I still find this a bit off.

  2. #2
    WS Lounge VIP
    Join Date
    Mar 2006
    Location
    Maryland, USA
    Posts
    690
    Thanks
    17
    Thanked 66 Times in 56 Posts
    Beats me. But it's maddening.

    Pam
    Pam Caswell

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Maybe you can code in a check for this. My first thought:

    Code:
    Sub DelSelection()
    ' Delete selection and clean up stray paragraph marks
    With Selection
        If .Type = wdSelectionNormal Then
            If .End + 3 <= ActiveDocument.Content.End Then
                ' Store a copy of the two characters that follow the selection
                Dim strTempBefore As String, strTempAfter As String
                strTempBefore = ActiveDocument.Range(.End, .End + 2).Text
                .Delete
                ' Store a copy of the three characters that follow the selection
                strTempAfter = ActiveDocument.Range(.End, .End + 3).Text
                If strTempAfter = vbCr & strTempBefore Then
                    ' Delete the vbCr at the insertion point
                    .Delete
                End If
            Else
                .Delete
            End If
        End If
    End With
    End Sub

  4. #4
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    This is the code that I referred to in my first post. It does work quite well. I'm deleting the range of a bookmark named 'test', but it could just as well be Selection.Range. I deal with the style in case I've concatenated a Heading 3 into a Heading 2. Heading 3 would prevail without the check.

    After using Replace to change the para mark into a period, the range deletes as I want it to.

    Sub rangedeletewithpara()
    Dim rng As Range
    Dim rngPara1 As Range
    Dim sStyle
    Set rng = ActiveDocument.Bookmarks("test").Range
    Set sStyle = rng.Paragraphs(1).Style
    Set rngPara1 = rng.Duplicate
    rngPara1.Expand
    rngPara1.Collapse wdCollapseStart
    rng.Text = Replace(rng.Text, vbCr, ".")
    rng.Delete
    rngPara1.Style = sStyle
    End Sub

  5. #5
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Chichester, UK
    Posts
    401
    Thanks
    1
    Thanked 10 Times in 9 Posts
    I can confirm this unwanted behaviour in Word 2007 and Word 2010. MS KB 917660 makes reference to this exact problem but goes on to say it is a design change whilst TRACK CHANGES are on. But this is now happening regardless of the status of Track Changes - even if they have never been on.

    So KB917660 is wrong and this is obviously a bug and not a by design change.

  6. #6
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    It does appear to be a bug. I've noticed that if the selection starts immediately 'in front of' the paragraph mark and continues into the following para, DELETE does in fact remove the mid-selection paragraph mark.

    So the paragraph mark gets deleted if it's the first character in the selection, but not otherwise. That is typically the situation for me: pulling a subsequent paragraph up into the previous paragraph.

  7. #7
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Chichester, UK
    Posts
    401
    Thanks
    1
    Thanked 10 Times in 9 Posts
    Having put this action to a member of the Word development team, this was the reply.

    "In this particular case, I do know that we made the change in Word 2007 to avoid unexpected merges. It was partially an extension of our logic around merging paragraphs with mixed styles but also really just what folks seem to more often want. So we biased towards you have to do an extra delete to merge rather than press an extra paragraph mark to separate. The mere fact that it's taken folks four years to notice and become concerned argues strongly that it really is the proper behavior -- and only "feels wrong" when you analyze it (that is "think" rather than "feel")."

    As said, it took four years to notice this, so it is probably correct behaviour even if we think it illogical!


  8. #8
    WS Lounge VIP
    Join Date
    Mar 2006
    Location
    Maryland, USA
    Posts
    690
    Thanks
    17
    Thanked 66 Times in 56 Posts
    Quote Originally Posted by Terry Farrell View Post
    Having put this action to a member of the Word development team, this was the reply.

    "In this particular case, I do know that we made the change in Word 2007 to avoid unexpected merges. It was partially an extension of our logic around merging paragraphs with mixed styles but also really just what folks seem to more often want. So we biased towards you have to do an extra delete to merge rather than press an extra paragraph mark to separate. The mere fact that it's taken folks four years to notice and become concerned argues strongly that it really is the proper behavior -- and only "feels wrong" when you analyze it (that is "think" rather than "feel")."

    As said, it took four years to notice this, so it is probably correct behaviour even if we think it illogical!

    Hmmmmm. But avoiding an expected merge is OK? I did notice this behavior 3 or 4 years ago. I'm usually on a rush job or doing some last minute copy fitting when it happens. I don't have time to do anything but curse Word and keep going. Bottom line, Word should do what I tell it to do.
    Seems like this is a good candidate for layout options.

    Thank you, Terry, for this information. Note that I am not at all blaming the messenger.

    Pam
    Last edited by PamCaswell; 2013-01-31 at 15:26.
    Pam Caswell

  9. #9
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts
    I recall an explanation from Microsoft a few years back that had to do with the prevailing style when a paragraph mark (with no leading text) is deleted. If you have a 3 section document and delete the section break between sections 1 and 2, the formatting of section 2 will prevail for the merged sections, as that formatting is stored in the section break which remains. The situation with a paragraph is the opposite; the 'upper' (first) paragraph prevails because MS felt that users would want to 'pull' the following paragraph into the upper paragraph. That does make sense... sort of. In my opinion, consistency is the better rule.

    Why not have a pop-up as with pasting... to ask which formatting should be used?

    It's one thing to use the two-step process (deleting the para mark as a separate step) when manipulating text interactively. It's annoying, but not really a hardship. My concern is what occurs when I delete text (with or without paragraph marks) using VBA. I can't "see" what might be left and need cleaning up. The code I wrote really does a good job of giving me what I want... so far.

  10. #10
    New Lounger
    Join Date
    Jan 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you richardbarrett for the VB code and to everyone for the discussion. It hadn't occurred to me to write a macro to get around the problem. It's simple enough, but it would have taken me a while to write since I don't use VB often enough. The default style behavior is what I need, so I deleted those lines. Other than that it was exactly what I needed.

    I'm glad to know I'm not the only one who considers this behavior a problem. I've been dealing with it every single day since I switched to Office 2010 from 2003, and it has been a constant irritation. If I could, I would have the Word developers know that I noticed this new behavior immediately, and it is NOT the proper behavior as far as I'm concerned. *sigh* Why there couldn't have been an option to control this behavior, or a pop-up, is beyond me.

    Thanks again for the discussion.

Posting Permissions

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