Microsoft KB Archive/119948

{|
 * width="100%"|

EditClear Deletes Multiple Spaces with Smart Cut and Paste

 * }

Q119948

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 6.0, 6.0a
 * Microsoft 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.