EditClear Deletes Multiple Spaces with Smart Cut and Paste

ID: Q119948

The information in this article applies to:

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:

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

Last Reviewed: August 5, 1997