EditClear Deletes Multiple Spaces with Smart Cut and Paste

Last reviewed: August 5, 1997
Article ID: Q119948
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a
  • Word for the Macintosh, versions 6.0, 6.0.1

SYMPTOMS

You may unintentionally delete more than one space when you run a macro such as the following that includes the EditClear statement.

Sub Main
  EditClear
End Sub

Even when a count of 1 is included in the statement, as in the following example, Word may ignore the count and delete multiple spaces.

Sub Main
  EditClear 1
End Sub

CAUSE

This problem occurs when you have the "Use Smart Cut and Paste" option turned on and any of the following conditions occur:

  • The insertion point follows certain characters, such as opening or closing parentheses, opening or closing quotation marks, or opening bracket.
  • The insertion point precedes two or more spaces.
  • No text is selected.

When the insertion point follows other types of punctuation (such as the opening or closing brace), or if one character space is selected following this punctuation, only one character is deleted.

STATUS

We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

RESOLUTION

To delete a single space from a series of spaces, use Clear from the Edit Menu. If you prefer to use a macro, clear the "Use Smart Cut and Paste" check box before running the macro. (To locate this option, choose Options from the Tools menu, select the Edit tab.)

MORE INFORMATION

EditClear is a WordBasic statement that deletes the current selection or one or more characters to the right of the insertion point. When included in a macro, it may include an argument called Count to delete a specified number of characters. When run from the Edit menu, Clear is used to delete the current selection or the character to the right of the insertion point. EditClear deletes text without changing the contents of the Clipboard.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

REFERENCES

"Microsoft Word User's Guide," version 6.0, page 43

"Microsoft Word Developer's Kit," version 6.0, page 388

Kbcategory: kbusage kbmacro KBSubcategory:


Additional reference words: 6.0 6.0a smart cut paste edit clear
macword 6.0.1 word6 editclear delete winword
Version : 6.0 6.0a | 6.0 6.0.1
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.