Deleting range removes space between text

B

Bob

I programmatically select a range which is then deleted.
New text or a hyperlink is then inserted, but it runs onto
the text that followed the range. The space between the
words has gone. How can I get the space back?

I tried altering the range end to be range.end - 1 but
that left a character behind when deleting.
 
J

Jezebel

Do the insert, check if the following character is a space; if not then
insert a space.

Or, instead of deleting the range and then inserting the new matter, simply
replace the target range with the new matter.
 

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