Re: Word 2007 Deleting across paragraphs does not delete paragraph
- From: "Graham Mayor" <gmayor@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 14 Jun 2009 08:50:01 +0300
I agree. I have already abandoned the macro. Given the number of times I
delete text across paragraphs I can live with this anomaly.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Lene Fredborg wrote:
You are right. And there is more.
Further observations:
In a protected form, deletion via the Delete key (without the macro)
works as in 2003 as far as I can see. The paragraph mark is gone
after pressing Delete.
Before I posted my macro, I tested it with tables fully or partly
selected and both with and without having selected text before or
after the table. The macro seems to work as "normal" delete (i.e.
2003 delete). I have now found out that your version fails if part of
a table is selected in combination with text before the table. And if
only part of a table is selected (without text before or after), the
result is not correct - or maybe it is better so say it this way: the
result is not the same as if one used the Delete key in 2003 or in
2007.
Another problem: even if the macro(s) were changed to handle the
above, the user would have to press Undo at least twice to undo the
deletion (unless Undo handling is also built into the macro).
All in all, I think I would skip the idea of using a macro - and then
I would prefer pressing Delete twice to overcome the problem with the
paragraph mark <g>
There is a snag - it doesn't work in protected form fields without
additional programming.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Lene Fredborg wrote:
I found the answer via the Shortcut Key dialog box ;-)
I had been racking my brains to think what the delete key command
was - Renaming the macro works just fine :)
Sub EditClear()
If InStr(Selection.Text, Chr(13)) Then
Selection.Text = Replace(Selection.Text, Chr(13), " ")
End If
Selection.Delete
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Lene Fredborg wrote:
Possible solution:
The command executed when pressing the Delete key is EditClear.
You could rename the deletion macro to EditClear and it will run
instead of the built-in command.
Thanks all - I have already updated my macros to replace
paragraphs marks with spaces and that does work, of course.
However, for my users, they still have the pain of having to
perform the selection delete and then delete the inserted
paragraph mark when they do this manually.
Surely, Microsoft can't believe that "delete this bit" means
"We'll delete it but add something in because you will always
need it and, no, you can't switch this off"???
Andy
"Graham Mayor" wrote:
Greg Maxey wrote:
How about:
Sub ScracthMacro()
If InStr(Selection.Text, Chr(13)) > 1 Then
Selection.Text = Replace(Selection.Text, Chr(13), " ")
Selection.Delete
End If
End Sub
Sub ScratchMacro()
If InStr(Selection.Text, Chr(13)) Then
Selection.Text = Replace(Selection.Text, Chr(13), " ")
End If
Selection.Delete
End Sub
Would delete the selected text whether or not the selection
contained a paragraph break which is closer to the Word 2003
behaviour.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
.
- References:
- Word 2007 Deleting across paragraphs does not delete paragraph mar
- From: ATD
- RE: Word 2007 Deleting across paragraphs does not delete paragraph mar
- From: Lene Fredborg
- Re: Word 2007 Deleting across paragraphs does not delete paragraph mar
- From: Greg Maxey
- Re: Word 2007 Deleting across paragraphs does not delete paragraph mar
- From: Graham Mayor
- Re: Word 2007 Deleting across paragraphs does not delete paragraph
- From: ATD
- Re: Word 2007 Deleting across paragraphs does not delete paragraph
- From: Lene Fredborg
- Re: Word 2007 Deleting across paragraphs does not delete paragraph
- From: Graham Mayor
- Re: Word 2007 Deleting across paragraphs does not delete paragraph
- From: Lene Fredborg
- Re: Word 2007 Deleting across paragraphs does not delete paragraph
- From: Graham Mayor
- Re: Word 2007 Deleting across paragraphs does not delete paragraph
- From: Lene Fredborg
- Word 2007 Deleting across paragraphs does not delete paragraph mar
- Prev by Date: Re: Transfer Files on CD into Documents
- Next by Date: Re: Saving a Word 2007 document
- Previous by thread: Re: Word 2007 Deleting across paragraphs does not delete paragraph
- Next by thread: Re: Word 2007 Deleting across paragraphs does not delete paragraph
- Index(es):
Relevant Pages
|