RobBroekhuis
Technical User
Here's an odd one. I'm trying to remove spaces at the end of paragraphs, using the following code:
The code seems to work well up to the erng.delete statement. If a single space at the end of the line is selected (I verify this by going in debug mode and executing erng.select from the immediate window), the erng.delete method does NOT delete the space - it just collapses the erng range. In just about any other situation, the range.delete method works as expected, deleting the desired range of text. Am I missing something?
Rob
Code:
erng.StartOf wdStory
erng.Find.Execute " ^p"
Do While erng.Find.found
erng.Collapse wdCollapseStart
erng.MoveEnd , 1
erng.MoveStartWhile " ", wdBackward
erng.Delete
erng.Find.Execute
Loop
Rob