Using Range.Delete inserts a space after the deleted character

A

Alex

When I use Range.Delete() to delete a character in a run, Word automatically inserts a space after it.

So, given: "aaaXbbb"
When "X" is deleted, the result is: "aaa bbb" (with a space in the middle)

I tried setting Options.SmartCutPaste to false but it does not help.

Please advise.


Best wishes,
Alex.
 
D

Doug Robbins

Use .Range.Text=""

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

When I use Range.Delete() to delete a character in a run, Word automatically
inserts a space after it.

So, given: "aaaXbbb"
When "X" is deleted, the result is: "aaa bbb" (with a space in the middle)

I tried setting Options.SmartCutPaste to false but it does not help.

Please advise.


Best wishes,
Alex.
 
A

Alex O.

[ posting via Google ]

Doug said:
Use .Range.Text=""

Same behavior as the .Delete, space gets inserted.

I am deleting the ']' character. Perhaps it is significant?
 
A

Alex O.

Update:

Happens on Word 2003 from a C# add-in I'm writing.
Cannot recreate it with Word 2000 using a macro.
 
A

Alex O.

[ posting from google ]

OK, more details:

I managed to recreate the problem with Word 2000 macros after all and
setting
Application.Options.SmartCutPaste = False
did solve the problem.

I'll revisit it again when I have access to Word 2003.

Best wishes,
Alex.
 
D

Doug Robbins

There is nothing between the first " and the second "

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
Alex O. said:
[ posting via Google ]

Doug said:
Use .Range.Text=""

Same behavior as the .Delete, space gets inserted.

I am deleting the ']' character. Perhaps it is significant?
 
P

Peter Huang [MSFT]

Hi

Thanks for your experience sharing in the community.
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top